facebook

DB Browser – SQL Server and multiple Schemas

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #227036 Reply

    I hope this is an easy question, but first I need to say that I am VERY new to Eclipse.

    Current status.
    I am using the opensource driver for Micrsoft SQL server and it appears to work great. I can use the db browser and type in a sql command manually and get back the results I expect.

    The issue is that I am loggin in with the sa account and I can’t actually browse any other schemas. I would like to browse another schema called timsdata.

    My connect string looks like this.
    jdbc:jtds:sqlserver://rdfmstims02:1433/timsdata;TDS=7.0

    What I currently see in the browser is a tree view with sa listed.
    I then click on the sa node and I see.
    System Table
    Table
    View

    All are empty when clicked on.

    I am using Ecipse 3.0.1 and 3.8.4+QF2

    My overall goal is to use this with Hibernate. So far it looks good, but this would be a very nice feature to have.

    #227039 Reply

    Riyad Kalla
    Member

    Let’s start by checking the log file to see if any exceptions are getting generated:
    <workspace dir>\.metadata\.log, look towards the bottom of it for exceptions related to the DB explorer.

    The good news is that we have other users using JTDS so we should be able to get this working…

    #227049 Reply

    Thanks for the response.

    Here is the end of the file that appears to gives us what we want. I could go back more, but it appears to repeat that over and over.

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Mar 23, 2005 10:52:04.648
    !MESSAGE Error getting table information
    !STACK 0
    java.sql.SQLException: Could not locate entry in sysdatabases for database ‘sa’. No entry found with that name. Make sure that the name is entered correctly.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:364)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2708)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2150)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:587)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:323)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:670)
    at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getTables(JtdsDatabaseMetaData.java:1785)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getTables(SQLDatabaseMetaData.java:603)
    at com.genuitec.eclipse.sqlexplorer.model.TableObjectTypeNode.ă(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.model.TableObjectTypeNode.getChildren(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.DatabaseContentProvider.getChildren(Unknown Source)
    at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:708)
    at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:477)
    at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:585)
    at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:359)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:342)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:754)
    at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:765)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:820)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:805)
    at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:2074)
    at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4002)
    at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:722)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3019)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:3338)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1397)
    at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:170)
    at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:1668)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3001)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:3338)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1473)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2429)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
    at org.eclipse.core.launcher.Main.run(Main.java:704)
    at org.eclipse.core.launcher.Main.main(Main.java:688)

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Mar 23, 2005 10:54:26.296
    !MESSAGE Error getting table information
    !STACK 0
    java.sql.SQLException: Could not locate entry in sysdatabases for database ‘sa’. No entry found with that name. Make sure that the name is entered correctly.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:364)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2708)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2150)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:587)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:323)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:670)
    at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getTables(JtdsDatabaseMetaData.java:1785)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getTables(SQLDatabaseMetaData.java:603)
    at com.genuitec.eclipse.sqlexplorer.model.TableObjectTypeNode.ă(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.model.TableObjectTypeNode.getChildren(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.DetailManager.activate(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.TableInfoView.setInput(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.DatabaseTreeViewer$4.selectionChanged(Unknown Source)
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:159)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616)
    at org.eclipse.core.runtime.Platform.run(Platform.java:747)
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:157)
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1394)
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:693)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:718)
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:180)
    at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:175)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:324)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
    at org.eclipse.core.launcher.Main.run(Main.java:704)
    at org.eclipse.core.launcher.Main.main(Main.java:688)

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Mar 23, 2005 11:14:29.683
    !MESSAGE Error processing query: ‘select * from patmas’
    !STACK 0
    java.sql.SQLException: Invalid object name ‘patmas’.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:364)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2708)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2150)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:587)
    at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:438)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:421)
    at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:931)
    at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:824)
    at com.genuitec.eclipse.sqlexplorer.views.SqlExecProgress.ā(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.SqlExecProgress.run(Unknown Source)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Mar 23, 2005 11:14:39.427
    !MESSAGE Error processing query: ‘select * from dims.patmas’
    !STACK 0
    java.sql.SQLException: Invalid object name ‘dims.patmas’.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:364)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2708)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2150)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:587)
    at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:438)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:421)
    at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:931)
    at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:824)
    at com.genuitec.eclipse.sqlexplorer.views.SqlExecProgress.ā(Unknown Source)
    at com.genuitec.eclipse.sqlexplorer.views.SqlExecProgress.run(Unknown Source)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

    #227051 Reply

    Riyad Kalla
    Member

    So it thinks that SA is actually a DB name and not a user name? Are you sure you went through the JTDS docs correctly and constructed your connection string appropriately? I ask because with the MS SQL Server JDBC driver from MS, you specify the user name and password as part of the URL, you don’t enter it in the boxes… so I wonder if JTDS is the same, and by entering it in the box, it is screwing up the connection string? (I don’t have experience with JTDS nor do I have a SQL Server install to test this again, so we will need to trouble shoot this one together).

    #227052 Reply

    I’ll dork with it, and give you an update. Thanks.

    #227054 Reply

    Ok this is very weird. I now have it working.

    I did add it to the url string so, my url string looks like.
    jdbc:jtds:sqlserver://rdfmstims02:1433/timsdata;user=reports;password=XXX;TDS=7.0

    However my Username MUST MUST MUST be the schema I want to work with. I then have to leave the password field blank. So it looks like
    User Name = timsdata
    password =

    This logs me in with the “reports” user but in the timsdata schema.

    Weird.

    Thanks for your help.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: DB Browser – SQL Server and multiple Schemas

You must be logged in to post in the forum log in