This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help!! i need help for my moblie database project..

 
jasmine keh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i recently doing a project on moblie database. i get from this site http://www.java-tips.org/content/view/356/39/
but i got problem compiling it show me these errors:
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:162: 'class' or 'interface' expected
import java.io.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:163: 'class' or 'interface' expected
import java.text.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:164: 'class' or 'interface' expected
import java.util.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:165: 'class' or 'interface' expected
import javax.servlet.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:166: 'class' or 'interface' expected
import javax.servlet.http.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:167: 'class' or 'interface' expected
import java.sql.*;
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:233: not a statement
"jdbc racle:thin:@localhost:1521:"+db,user,pwd);
^
C:\WTK22\apps\testMySQLSuite\src\testMySQL.java:233: ';' expected
"jdbc racle:thin:@localhost:1521:"+db,user,pwd);
^
8 errors
com.sun.kvem.ktools.ExecutionException

is there anyone can help me on this? thanks..
 
fred rosenberger
lowercase baba
Bartender
Posts: 12266
36
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm assuming you put all that into one file? you can't have import statements in the middle - they must be at the beginning...

try putting each class in it's own file, appropriatly named, and see if that helps.
 
payal agrawal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You need to compile MIdlet with necessary java class files, I assume you have set class path for same.Servlet class should be put in web server.

The error that you are recieving of ";" is probably becuase you need to comment that line, it shows the connection string for oracle database.If you want to connect to oracle database you should look at the code and accordingly uncomment or comment the lines.
Example shows connection with mySQL database but it also has commented code to connect to oracle and SQL.Though I have corrected code on tip URL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic