• Post Reply Bookmark Topic Watch Topic
  • New Topic

code not running after compiling successfully

 
harshal deolekar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i created simple jdbc file having following code.saved it as Jdbc.java
i created a database called demo throughenterprise manager of sql server 2000
in demo i created connect table having dsn name "Mydsn"
i set path=C:\Program Files\Java\jdk1.6.0_11\bin which loaded my javac compiler..
my file got compiled successfully...
but file is not running.. its showing bug [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
i m not getting what to do .. please do help me



[Edit - added code tags - see UseCodeTags for details]
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look for blanks characters in the columns you are trying to retrieve and remove them, if any.
let us know if the problem persists.
 
Rob Spoor
Sheriff
Posts: 20837
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your first column contains a value that cannot be converted into an int. Perhaps the column order isn't what you expect it to be, which can (and should) be solved by not using SELECT * but specifying the columns you want.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!