When using a query involving INNER JOIN on SQL Server 2k, I get an exception when
using JRun 3.l's provided JDBC datasource.
Error:
java.sql.SQLException: [JRun][SQLServer JDBC Driver][SQLServer]Invalid object name
'cam_geocode'.
Sample Code (including query):
// BEGINNING OF SAMPLE SNIPPET
Class.forName("allaire.jrun.jdbc.JRunDriver");
String url = "jdbc:jrun:sqlserver://127.0.0.1:1433;databaseName=mydb";
Connection con = DriverManager.getConnection(url, hiddenforsecurity,
hiddenforsecurity);
Statement stmt = con.createStatement();
String query = "SELECT cam.salescode, cam.name, cam.first_name, cam.last_name,
cam.gmbo, cam.vpgm, cam.msa_name, cam.cam_phone, cam_geocode.ID, cam_geocode.long,
cam_geocode.lat FROM cam INNER JOIN cam_geocode ON cam.salescode = cam_geocode.ID
WHERE name LIKE '%davis%' ORDER BY name";
ResultSet rs = stmt.executeQuery(query);
rs.close();
stmt.close();
con.close();
// END OF SAMPLE SNIPPET
I have to register the driver in my code, and do not want to use JDBC Datasource
naming for this particular area.
Are JRun's drivers unable to handle simple joins, when registered in my own servlets?
Is there something really simple that I've overlooked? This happens on any query where
I am accessing more than one table and need to identify the columns per object
(tableobj.column) - JOINS, UNIONS, etc. Works fine on single-table queries.
Thanks,
TD
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists