sample code for JDBC:
class connect
{
ResultSet rs;
Statement stmt;
connect()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:temp",username,password);
stmt=con.createStatement();
String query;
ResultSet rs = stmt.executeQuery(query);
}
in query always append "+". e.g.:
"insert into debit values ("+mob_no+","+amount+")"
class connect
{
ResultSet rs;
Statement stmt;
connect()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:temp",username,password);
stmt=con.createStatement();
String query;
ResultSet rs = stmt.executeQuery(query);
}
in query always append "+". e.g.:
"insert into debit values ("+mob_no+","+amount+")"
Comments
Post a Comment