Unix Technical Forum

jdbc:java problem

This is a discussion on jdbc:java problem within the MySQL forums, part of the Database Server Software category; --> String sqlstring ="select host,port,username ,password,LastCrawlState from HostTable where id ="+id; System.out.println(sqlstring); rs = stmt.executeQuery(sqlstring); The result is : select ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 09:17 AM
Baby Lion
 
Posts: n/a
Default jdbc:java problem

String sqlstring ="select host,port,username
,password,LastCrawlState from HostTable where id ="+id;
System.out.println(sqlstring);
rs = stmt.executeQuery(sqlstring);

The result is :

select host,port,username,password,LastCrawlState from HostTable where
id =1
Exception in thread "main" java.lang.NullPointerException
at Host.<init>(Host.java:65)
at TestTwo.main(TestTwo.java:9)

but the same Query I executed in mysql Query Brower had the right
answer ,why?

select host,port,username,password,LastCrawlState from HostTable where
id =1

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:57 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com