This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes can i connect to MS  sql server without creating a dsn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can i connect to MS  sql server without creating a dsn" Watch "can i connect to MS  sql server without creating a dsn" New topic
Author

can i connect to MS sql server without creating a dsn

Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
hi all,
i was just wondring if i can connect to a MS sql server database without using a dsn using the JDBC-ODBC bridge, just as we do with other jdbc drivers.
any help is greatly appreciated.
Subbu
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not fou
nd and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at msjdmc.main(msjdmc.java:16)


Subbu
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

The jdbc-odbc bridge isn't generally recommended for "real-world" usage. It isn't optimized and it isn't considered thread-safe. Most DBMS vendors provide a native jdbc driver. Microsoft doesn't. There are a number of third-party ones available, though most will cost you.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: can i connect to MS sql server without creating a dsn
 
Similar Threads
ODBC and Microsoft access
[Microsoft][ODBC Driver Manager] Invalid string or buffer length exception for 64 bit SQL Server
Microsoft JDBC Driver Connection Problem
Doubt on Servlet having database connection?
Unable to connect to MS SQL Server using JRun drivers