aspose file tools*
The moose likes JDBC and the fly likes [Microsoft Driver] error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "[Microsoft Driver] error" Watch "[Microsoft Driver] error" New topic
Author

[Microsoft Driver] error

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
I am unable to connect to Microsoft Driver.....

Its giving the error as a cannot find the DNS name even though I connected to Microsoft driver by giving the name as MobileX. Its not connecting.

I loaded the driver by Class.forName("sun.odbc.jdbc.OdbcJdbcDriver");

And While in conn=DriverManger.getConnection("jdbcdbc:MobileX");

Here MobileX is the DNS name.


Its throwing exception as SQLException. I catched But could not find the solution.


thanks in advance


regards
amit bhadre


Thanks advance who ever answers this question.


regards
amit bhadre
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
So what's the message in the exception? Post the full stack trace.


Ping & DNS - updated with new look and Ping home screen widget
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Amit,

do you use
"sun.jdbc.odbc.JdbcOdbcDriver" or do you use
"sun.odbc.jdbc.OdbcJdbcDriver" in your code?

Herman
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
I used "sun.jdbc.odbc.JdbcOdbcDriver"

Now I got result as Driver is loaded.

Problem I now getting is Connction con=DriverManager.getConnection("jdbcdbc:MobileX");

In this line connection is not happening to SQL server.I used MobileX as Data Source Name and connecting to MobileX Data Source in sql server.
what is the solution?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why are you using the jdbc-odbc bridge to connect to SQL Server? Have you considered a proper type-4 driver like Microsoft's own or jTDS?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
No I have'nt used type 4 driver...how to use type 4 driver ot jTDS?

please tell me the solution?


thanks in advance....


regards
amit bhadre
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Just download Microsoft's own driver or jTDS's driver and follow the documentation. I only mention it because using the JDBC-ODBC bridge is not recommended where an alternative exists.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Microsoft Driver] error
 
Similar Threads
Crystal clear report generation and JDBC
creating virtual tables
jsp to ms access connection
JDBC:ODBC Oracle Connection
iam getting an error while running a servlet program