Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

sun.jdbc.odbc.JdbcOdbcDriver

  Asked By: Craig    Date: Oct 27    Category: Java    Views: 1848
  

I am new to Java word. Can I find the source code for
sun.jdbc.odbc.JdbcOdbcDriver? Where?
I need this to see the mapping ODBC->JDBC,becouse I want write
an c/c++ ODBC driver and I have the JDBC driver.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Midissia Lopez     Answered On: Oct 27

the code  for jdbc.odbc driver
created on windows 2000 server with the dsn name hide

the code: -

-----------------------------------------------------
import java.sql.*;
import java.util.*;
import java.lang.*;

class ConnectApp {
public static void main(String args[])
{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection =
DriverManager.getConnection("jdbc:odbc:hide", "sa",
"");
DatabaseMetaData meta = connection.getMetaData();
System.out.println("Database:
"+meta.getDatabaseProductName());
System.out.println(" version
"+meta.getDatabaseProductVersion());
System.out.println("User Name:
"+meta.getUserName());
connection.close();
}
catch(Exception ex) {
System.out.println(ex);
System.exit(0);
}
}
}
------------------------------------------------------------------
u can create a odbc  driver using the JNI(java native
interface) and use the driver  for c++ programs

 
Didn't find what you were looking for? Find more on sun.jdbc.odbc.JdbcOdbcDriver Or get search suggestion and latest updates.




Tagged: