Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Craig Daniels   on Oct 27 In Java Category.

  
Question Answered By: Midissia Lopez   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

Share: 

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


Tagged: