Skip to main content

Posts

Showing posts with the label jdbc code

JDBC

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+")"