cancel
Showing results for 
Search instead for 
Did you mean: 

jdbd sqlserver only connects to master db....

Former Member
0 Kudos

I have used this document (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424)

to install the jtds-1.2.jar sqlserver jdbc driver.

Then I tested the connection using the test servlet (step 15 from the document) at http://<hostname>:<port>/TestJDBC_Web/TestJDBCPage.jsp.

It succesfully makes a connection to my sqlserver, but it shows the tables from the master db and not my test database....

In the Connection Container I entered the following properties in Managed Connection Factory:

DriverName = net.sourceforge.jdts.jdbc.Driver

FixedCatalog = testdb

FixedSchema = dbo

Password = ***

URL = jdbc:jtds:sqlserver://sapserver;database=testdb

UserName = testuser

Why is not connecting to my database?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solved it on my own!

For who's having the same problem:

The URL should be: jdbc:jtds:sqlserver://sapserver:1433;<b>DatabaseName</b>=testdb

Besides that: the test servlet only uses the default JDBC connection. If you clone it to have connections to other sqlserver databases, these new connections will not appear in the test servlet.

The solution is to manually add these connections to the second test page:

http://<hostname>:<port>/TestJDBC_Web/TestJDBCPage2.jsp?sys_jdbc=<connection_name>;