It's not a secret anymore!*
The moose likes JDBC and the fly likes exception while running my first jdbc code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "exception while running my first jdbc code" Watch "exception while running my first jdbc code" New topic
Author

exception while running my first jdbc code

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

i have make database in my microsoft sql server and created tables and all , then i test the connection in the odbc data source administrator it gives me succesfull result ( ms normally as we do in sql server ) ...thinks are fine till this
then i have coded my first jdbc code where i m selecting all the values in my emp table which is in emp database.

this code gives me an exception which is


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You spelled the class's name incorrectly. Check it against your original code sample. (Capitals are important, Java is case-sensitive.)
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

Paul Clapham wrote:You spelled the class's name incorrectly. Check it against your original code sample. (Capitals are important, Java is case-sensitive.)

where i have spelled the class name incorrectly can you tel me please ?
the same code was running fine when mine ma'am is teaching us in class
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

There's only one possibility. It's here:

You have some online information? Just copy the class name from there and paste it next to what you have. See the difference?
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

Paul Clapham wrote:There's only one possibility. It's here:

You have some online information? Just copy the class name from there and paste it next to what you have. See the difference?

i have changed to this


and one more thing i have installed sql server driver 3.0 i have installed in and set the class path in the system and ide also
now my code looks like

and the exception now is

even though i have the latest JRE ie jre 6 update 26
now whats the problem can you tell me ???
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I don't understand why you ask "what is the problem". You have an error message which tells you exactly what the problem is. Not only that,
it tells you what you must do to fix the problem.

Asking people to read and interpret error messages for you isn't going to be a good strategy for getting ahead. In future I recommend that you
read the error messages for yourself. If you don't understand an error message, then go ahead and ask a specific question about the error
message.
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

Paul Clapham wrote:I don't understand why you ask "what is the problem". You have an error message which tells you exactly what the problem is. Not only that,
it tells you what you must do to fix the problem.

Asking people to read and interpret error messages for you isn't going to be a good strategy for getting ahead. In future I recommend that you
read the error messages for yourself. If you don't understand an error message, then go ahead and ask a specific question about the error
message.

ya i understand that the errror message is prety much straight but what i m saying is i hav ethe latest JRE then why this problem is occuring
i have checked my java version it is JRE 6 update 26 which is a latest version i guess ?
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Are you reading the same error message that we are reading?

Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
 
Consider Paul's rocket mass heater.
 
subject: exception while running my first jdbc code
 
Similar Threads
how to upload pdf files to My sql with java
cant connect to mysql
ClassNotFoundException Mysql
class loader problem during connection of MySql driver
com.microsoft.sqlserver.jdbc.SQLServerException is troubling me can any help please