This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes JDBC and the fly likes Driver is not supporting to retrive primary key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Driver is not supporting to retrive primary key" Watch "Driver is not supporting to retrive primary key" New topic

Driver is not supporting to retrive primary key

prakash narkodu

Joined: May 23, 2003
Posts: 5
i use odbc jdbc driver in my project to retrive database from sql server as well as access. I sucessfully retrived database tables but not retriving primary key. it shows error "driver not supported this funciton".So jdbc dbc driver supported these function if it is not then which driver I can use.
folling is the function that I am using in my program.

public Vector gettingPrimaryKey(String strDbUrl1,String strDbName1, String strLogin,String strPwd,String strTable)
String s;
String strUsr2;
Vector vecPkCol=new Vector();
if(strDataBaseType.equalsIgnoreCase("Oracle 8i"))
String strUsr1=strLogin;
strUsr2= strUsr1.toUpperCase();
s = strDbName1;
String t = null;
String u = null;
String[] vt = {"TABLE"};
Connection con = DriverManager.getConnection (strDbUrl1,strLogin, strPwd);
Statement stmt1=con.createStatement();
DatabaseMetaData db = con.getMetaData();
ResultSet rs = db.getTables(s,t,u,vt);
ResultSet rsPrimaryKey = db.getPrimaryKeys(s, null, strTable);
while (
String strPkColName=strTable+"."+strPkColumnName;
} catch(Exception se)
return vecPkCol;
I agree. Here's the link:
subject: Driver is not supporting to retrive primary key