Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about "Java Cookbook: Solutions and Examples for Java Developers"

 
Rob Earls
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it have any solid examples of JDBC coding. I seem to be struggling with it at the moment.
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the index there is a whole chapter on Database Access
Good luck with your JDBC
[This message has been edited by Johannes de Jong (edited September 25, 2001).]
 
Siddalinga Murthy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
java.sql.Connection JDBCconnection= DriverManager.getConnection(DBConstants.DB_URL, DBConstants.DB_User, DBConstants.DB_Password);
}
Statement statement1=JDBCconnection.createStatement();
ResultSet rs=statement1.executeQuery("SQL QUERY")
rs.next();
 
John Sinues
Ranch Hand
Posts: 52
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic