Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JDBC driver location

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, All,
I�m not very experienced Java programmer and I�m looking for some help.

I�m trying to write an applet to access database located on MS SQL Server. My code is working fine when I�m running it as application. When I�m running it as an applet, it can�t find the JDBC driver.
Development environment:
JDK 1.4 (beta, downloaded from Sun)
Java compiler is located in D:\Java\bin folder
Compiler starts with CLASSPATH pointing to the folders required by MERANT.
JDBC driver has been downloaded from MERANT and located in D:\Java\Jdbc\lib folder.
Editor � TextPad (also used to compile and run Java applications). Performs well so far.
Browser � IE 5.5 with lates Java plugin
All HTML files hase been processed with HTMConverter offered by Sun to update for new plug in version of JVM.
The code causing troubles:
public boolean Connect (){
try{
// Load DB driver
Class.forName("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
// Connect to the DB
con = DriverManager.getConnection("jdbc:merant:sqlserver://SQLSrv:1433","sa","");
}
catch(SQLException sqlException){
JOptionPane.showMessageDialog(null, sqlException.getMessage(), "DB Error", JOptionPane.ERROR_MESSAGE);
return false;
}// End of SQLException catch
catch(ClassNotFoundException classNotFound){
JOptionPane.showMessageDialog(null, classNotFound.getMessage(), "Driver not found", JOptionPane.ERROR_MESSAGE);
return false;
}// End of "Driver not found"
return true;
}// End of the Connect method

[This message has been edited by Leonid Kizelshteyn (edited December 21, 2001).]
 
And inside of my fortune cookie was this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic