Using JDBC in VisualAge for Java

Team-Fly

When using VisualAge for Java, you do not have to know too much about the JDBC interface to access the database. The following bits of code illustrate some key points.

To connect to the database:

java.sql.connection jc =  java.sql.DriverManager.getconnection("jdbc:db2:Matrix");

To create a statement object:

java.sql.statement obj = jc.createStatement();

To execute a query from the Customer table:

java.sql.ResultSet sql = obj.executeQuery("Select * from customer");

To try these examples, you must have DB2 running on your machine. Then, you can try the examples yourself in the VisualAge for Java Scrapbook.


Team-Fly


Java & BAPI Technology for SAP
Java & BAPI Technology for SAP
ISBN: 761523057
EAN: N/A
Year: 1998
Pages: 199

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net