gate - How to use java code to access MySQL DB in Jape grammer‏ -


how can use following codes in rhs of jape grammer?

class.forname("com.mysql.jdbc.driver"); ... connection con=drivermanager.getconnection(url+dbname+addon,dbuser,dbpasswd); ... preparedstatement statement = con.preparestatement(querystring); resultset result; result = statement.executequery(); 

i have refered user guide , add following import @ beginning of file:

imports:{ import java.io.file; import java.io.ioexception; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; } 

the error saw in message tab

error: unhandled exception type classnotfoundexception @ line 70 in japeactionclasses.instancespairactionclass28 error: unhandled exception type sqlexception @ line 80 in japeactionclasses.instancespairactionclass28 error: unhandled exception type sqlexception @ line 101 in japeactionclasses.instancespairactionclass28 .... 

line 70 exactly:

class.forname("com.mysql.jdbc.driver"); 

so, seems java mysql connector not found. how can configure in gate? adding jar in building path under eclipse.

how use gate2mysql plugin? if not possible , wish use approach described above, please make sure put mysql driver jar file in gate classpath.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -