Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class.forName

 
Philip Pross
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm presently learning JDBC, I've done alot of examples for applications, as soon as I turned towards working with applets local in my pc (appletviewer), I've had problems.
I've study the tutorials on the web, and even with this example I found I'm getting errors.
The error is in the try ..... Class.forName
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
}
catch(Exception ex)
{
setError("Can't find Database driver class: " + ex);
return;
}
Has anyone seen this before?
Thanks
Phil
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard of some databases being 'picky' as to having '.newInstance()' tagged on to the end of the Class.forName method. try:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
-->doesn't have the newInstance() method at end.
Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic