chan
Posts: 2
Nickname: champion
Registered: Feb, 2002
conncect to database/JDBC
Posted: Mar 6, 2002 1:31 PM
Advertisement
I am trying to connect to a sybase database using the JDBC classes, but it is telling me the driver is not found. I have been working on it and can't figure out what the problem is. Here is the code... help please. thanks. import java.util.*; import java.sql.*; public class DataSheetRetriever { public static void main(String[] args) { Connection con = null; String Driver = "com.sybase.jdbc2.jdbc.SybDriver"; String URL = "jdbc:sybase:Tds:"; String Host = "10.73.2.11:2010/NGSIDB"; String userid = "guest"; String passwd = "guestsun"; try { Class.forName(Driver).newInstance(); con = DriverManager.getConnection(URL+Host, userid, passwd); Statement select = con.createStatement(); } catch(Exception e) { System.err.println("Unable to load the Sybase Driver " + e.getMessage() ); if(con != null) { try{ con.close(); } catch(Exception ee){} } } DataSheetRetriever dsr = new DataSheetRetriever(); } public Vector getDatasheet(String siteId) { Vector v = new Vector(); return v; } }