Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.sql.SQLException with jdbc:odbc bridge driver and api

Reply
Thread Tools

java.sql.SQLException with jdbc:odbc bridge driver and api

 
 
Kermit Piper
Guest
Posts: n/a
 
      06-11-2006
Hello,

I've seen a lot of information on this error: java.sql.SQLException:
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified.

However, the only definitive solution I can find is going to Control
Panel-->Administrative Tools-->Data Sources(OBDC)-->System DSN-->etc. I
did this and the connection tests fine. So, this is not the cause of
the error in this case. So, given what I have explained and the snippet
below, can someone please offer some help in resolving this. I am
running in the following environment: Windows XP Pro, SQL Server 2000,
JBoss 4.0.2, JDK 150_07.

1. created my database
2. created a system DSN
3. did the required modifications in it
4. added the rt.jar to the web-inf\lib dir and did another build, then
restarted JBoss.

// JDBC:ODBC bridge using api and using table:

This method is used in my LoginServlet:
public String validateUser(String inputUserid, String inputPwd) throws
SQLException
{
String returnString = null;
String dbUserid = "testuser";
String dbPassword = "password" ;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException cnfe)
{
System.out.println(cnfe);
}
try
{
Connection con =
DriverManager.getConnection("jdbcdbc:LocalServer ",
dbUserid ,dbPassword);
Statement stmt = con.createStatement();
String sql = "select USERID from USERTABLE where USERID
= '" +
inputUserid + "' and PASSWORD = '" + inputPwd +"' ;" ;
ResultSet rs = stmt.executeQuery(sql);
if (rs.next())
{
returnString = rs.getString("USERID");
}
stmt.close();
con.close();
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
return returnString ;
}

Any help would be greatly appreciated.
Thanks,
KP

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repost: java.sql.SQLException with jdbc:odbc bridge driver and api Kermit Piper Java 1 06-13-2006 08:47 AM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Bridge/workgroup bridge scenario and channels Chris_D Cisco 6 08-05-2005 07:46 AM



Advertisments