File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes MS SQL driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "MS SQL driver" Watch "MS SQL driver" New topic

MS SQL driver

ray bond
Ranch Hand

Joined: Oct 11, 2000
Posts: 111
hello there , I have two systems server(winnt) and desktop(win98), MS SQL database is on server and it has "Bookmark " database , I have created jdbc application to get rows from that database , on my desktop system I have configured ODBC datasource
and connected "bookmarkdb" data source with "Bookmark" database on server and also tested connection , it is OK ,
but when I run my jdbc application on my desktop system , on console window it just print out "jdbc.odbc.JdbcOdbcDriver" and nothing else , code of application is below , please can somebody tell me what should I do so I can get this application working and it prints qurery results , is there any thing wrong with driver ,I have tried same process with MS access database as well , but still on console it prints "jdbc.odbc.JdbcOdbcDriver" , do I have to use other driver for MS SQL , if so then which driver, thank you
import java.sql.*;
public class db

public static void main(String args[])

String username;
String password;
String name;
String email;

Connection con = DriverManager.getConnection("jdbc.odbc.bookmarkdb","","");
System.out.println("got connection");
Statement stmt = con.createStatement();

ResultSet rst = stmt.executeQuery("SELECT * FROM information");
username = rst.getString(1);
password = rst.getString(2);
name = rst.getString(3);
email = rst.getString(4);
catch(Exception e)
[This message has been edited by ray bond (edited December 21, 2000).]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
This is the wrong format:
Connection con = DriverManager.getConnection("jdbc.odbc.bookmarkdb","","");
What you want is:
Connection con = DriverManager.getConnection("jdbcdbc:bookmarkdb","","");

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
ray bond
Ranch Hand

Joined: Oct 11, 2000
Posts: 111
hello thomas ,
thank you for your reply , I modified my mistake , but
still when I run application on dos prompt it prints out
"jdbc.odbc.JdbcOdbcDriver" and nothing else , I tried same application with MS access on my local system and also configured
DSN for that , but still it prints out "jdbc.odbc.JdbcOdbcDriver", what should I do to print out result set on command prompt.
thank you
I agree. Here's the link:
subject: MS SQL driver
It's not a secret anymore!