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

SQLJ in Netbeans

 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to Run SQLJ in NetBeans

Code Working fine in Notepad and Command Prompt.

But not working in netbens ,

What are the steps to run SQJL in NetBeans ( Using DB2)
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And read also TellTheDetails
 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Code for sqlj is something like this



This code working nice in Command Prompt with Notepad.


But while trying to execute it on NetBeans IDE it is returning an error


Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at jdbc_demo.Sample.getFName(Sample.java:33)
at jdbc_demo.Sample.main(Sample.java:47)
Java Result: 1
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please always use the code button; since you are new, I have edited your post and you can see how much better it looks.
That error from NetBeans is very unhelpful, unless it means the line beginning #sql (which isn't legal Java™ or any description). The line numbers appear to be different from what NetBeans is using.
 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to resole the issue,

Any way to overcome the problem

so that i can use sqlj in netbeans
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell us which line number is causing the problem. Compile the code and tell us the error message.
 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 31

#sql{ SELECT name into :first_name FROM staff WHERE id=:eid};

Error Message in NetBeans

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at jdbc_demo.Sample.getFName(Sample.java:31)
at jdbc_demo.Sample.main(Sample.java:42)
Java Result: 1
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've already told you the #sql bit looks incorrect.
 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply

But I am looking for solution not the problem

any body knows the solution of the above mentioned problem .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic