Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Syntax Error On Token "(", ";" expected

 
mangala madhusudhan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

This is madhusudhan.
i am using websphere application developer 5.1.2 for developing strtus application.
i write JDBC connection pool code in Action Class excute() .

I received " syntax error on token "(",";" expected " in line "private Connection getConnetion()"

Please send me mail for this error.

Connection con = this.getConnection();


private Connection getConnection() throws SQLException {

try
{
Context ctx = new javax.naming.InitialContext();
System.out.println("Before DS");
DataSource ds = (DataSource) ctx.lookup("jdbc/DataSourcePPT");
System.out.println("after DS");
//Connection dbConnection = ds.getConnection();
//System.out.println("After Connetion");
}
catch (NamingException ne) {
System.out.println("Naming Exception"+ne);
}
catch (SQLException se){

System.out.println("SQLEXception"+se);

}
catch(Exception e)
{
System.out.println("Error in"+e);
}
return ds.getConnection();
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic