• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic