Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception while running my first jdbc code

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic