- This topic has 6 replies, 3 voices, and was last updated 18 years, 4 months ago by Brian Fernandes.
-
AuthorPosts
-
mcolwellMemberI can connect OK to DB2 UDB V8.2, but it shows no schemas. If I try to ADD a schema it gets an SQLException with an sql error code of 443 stating that some invalid “routine” is being called.
The same thing happens with both the APP driver and the Universal Driver.
Haris PecoMemberMcolwell,
Please send us complete log,your OS vendor and version and jdbc version.
Can you try connection with next simple java app :import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; public class TestDriver { private static String driverName = "com.ibm.db2.jcc.DB2Driver"; private static String url = "jdbc:db2://<YOUR_HOST>:<YOUR_PORT>/<YOUR_DATABASE>"; private static String username = "YOUR_USERNAME"; private static String password = "YOUR_PASSWORD"; public static void main(String[] args) { try { Class.forName(driverName); Connection connection = DriverManager.getConnection(url,username,password); ResultSet schemas = connection.getMetaData().getSchemas(); while (schemas.next()) { System.out.println(schemas.getString(1)); } } catch (ClassNotFoundException e) { e.printStackTrace(); System.exit(1); } catch (SQLException e) { e.printStackTrace(); System.exit(1); } System.out.println("Connection is fine"); } }
You should exchange url, username and password with your data and add jdbc driver in classpath.
The application will print your schemas, if all is fine.About adding schema : how you add schema and what is error , exactly
Best regards
mcolwellMemberI can connect OK. But I don’t see any tables. I can run a select and get results. I edited the connection dialog where you can define what schemas to use. When I click the ADD button I get the exception. If I leave ALL schemas selected I don’t see any.
I have a screen image of it. How can I include it here?[/url]
Haris PecoMemberScreen image isn’t important.I understand your problem and i suppose that it’s driver problem
(or driver – database incompatibility)Open error log view (Windows-Preferences-Show view-Other-PDE Runtime-Error log) and paste
contents from this view.Can you try application from previous post
It is simple java application and you can execute in some java porejct (just add your jdbc to classpath)
What is your OS, jdbc version, eclipse and MyEclipse versions ?
Best regards
mcolwellMemberI can connect the DB2 Server from the DB Browser. I can even run SQL to it and get results. There is NO problem with the jdbc drivers or getting connected. It has to do with trying to list the schemas. If I EDIT the “Database Profile” in the DB Browser, click Next, then select “Display the selected schemas:” and click the “Add” button, I get the exception.
The end result is the DB Browser does not show me ANY tables in the tree within the DB Browser view.
Here is the error:
!ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2006-06-09 14:00:27.437
!MESSAGE Unable to retrieve database metadata
!STACK 0
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -443, SQLSTATE: 38553, SQLERRMC: SYSIBM.SQLTABLES;TABLES;SYSIBM:CLI:-805
at com.ibm.db2.jcc.c.zc.d(zc.java:1351)
at com.ibm.db2.jcc.b.eb.l(eb.java:366)
at com.ibm.db2.jcc.b.eb.e(eb.java:102)
at com.ibm.db2.jcc.b.r.e(r.java:72)
at com.ibm.db2.jcc.b.tb.i(tb.java:194)
at com.ibm.db2.jcc.c.zc.q(zc.java:1319)
at com.ibm.db2.jcc.c.ad.d(ad.java:2283)
at com.ibm.db2.jcc.c.bd.U(bd.java:188)
at com.ibm.db2.jcc.c.s.a(s.java:7814)
at com.ibm.db2.jcc.c.s.Wd(s.java:6423)
at com.ibm.db2.jcc.c.s.getSchemas(s.java:6351)
at net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getSchemas(SQLDatabaseMetaData.java:242)
at com.genuitec.eclipse.sqlexplorer.wizards.ConnectionProfileWizardSchemaPage$5.widgetSelected(ConnectionProfileWizardSchemaPage.java:239)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
at org.eclipse.jface.window.Window.open(Window.java:787)
at com.genuitec.eclipse.sqlexplorer.actions.EditConnectionProfileAction.run(EditConnectionProfileAction.java:36)
at com.genuitec.eclipse.sqlexplorer.actions.AbstractConnectionProfileAction.run(AbstractConnectionProfileAction.java:48)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
mcolwellMemberI found the problem. The was some binding problems with the database server and hence the call to getSchemas on the DatabaseMetaData failed.
Once I ran the following command on the server it worked:
db2 bind db2schema.bnd BLOCKING ALL GRANT PUBLIC
More info can be found at http://www-1.ibm.com/support/docview.wss?uid=swg21113531
Thanks
Brian FernandesModeratorMcolwell,
Glad it’s working for you. Thank you for posting back so that other users might benefit from your work.
Best,
Brian. -
AuthorPosts