How use progress in Java with JDBC

sekero

New Member
My question is in the code of java the links qith the table is correct but the call to the database is not correct. The code is:
String url = "jdbc:jdbcprogress:T:localhost:4000:D:\\Dlc\\sports.db";
Connection con;
String query = "select Item.Item-Num " +
"from Item";
Statement stmt;

try {
Class.forName ( "com.progress.sql.jdbc.JdbcProgressDriver" );
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try {
con = DriverManager.getConnection(url, "sysprogress", "s");
stmt = con.createStatement( );
//the error is this
ResultSet rs = stmt.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
}
catch{}

All is correct before the line ResultSet rs = stmt.executeQuery(query); the java error is the table or column is not exist but this exist. The conexion is well. Tell me please what is the error and that library of progress i have agregate to code.
Thanks for yur answer.
 

Casper

ProgressTalk.com Moderator
Staff member
What is the exact error you get?
(Don't know if I can help, but I'll try :)

Casper.
 

Casper

ProgressTalk.com Moderator
Staff member
Does it help if you put extra hyphen around the statements, like:

'SELECT Item."Item-num" FROM PUB.Item' or some other combination?
I think sql92 needs hyphen around field with special chracters like - and _. Als from Item should be form PUB.Item.

(Sorry didn't try this in java...)

Casper.
 

sekero

New Member
The error is this
SQLException: [JDBC Progress Driver]:Tabla/Vista/Sinónimo no encontrada (7519)
no encontrada = not found , table,view;
Thank´s
 

Casper

ProgressTalk.com Moderator
Staff member
same question in both threads I guess :)

Did you try it with PUB.Item and hyphens around the field-name.

In 9.1D (I don't know prior to 9.1D) the fieldname of item number in the item table (sports2000) = itemnum and not item-num. Are you sure in 9.1C the field-name is item-num?

Casper.
 
Top