当前位置: 技术问答>java相关
散分先!大家进来讨论一下!
来源: 互联网 发布时间:2015-10-23
本文导语: 各位兄弟姐妹:在下将要学习EJB这个高深的版块了,以后麻烦大家也是在所难免了,先散点分,请大家奉献一点关于学习这方面的宝贵心得!谢谢大家!只有这么一点分,请大家笑纳! | import java.sql.*; p...
各位兄弟姐妹:在下将要学习EJB这个高深的版块了,以后麻烦大家也是在所难免了,先散点分,请大家奉献一点关于学习这方面的宝贵心得!谢谢大家!只有这么一点分,请大家笑纳!
|
import java.sql.*;
public class JdbcTest
{
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@sanjin:1521:rgom",
"yxdba", "yxdba");
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
stmt.executeQuery("select * from aa");
ResultSet results = stmt.getResultSet();
while (results.next())
{
String firstName = results.getString("aaa");
System.out.println("firstName" + firstName);
}
conn.close();
}
catch (Exception exc)
{
exc.printStackTrace();
}
}
}
public class JdbcTest
{
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@sanjin:1521:rgom",
"yxdba", "yxdba");
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
stmt.executeQuery("select * from aa");
ResultSet results = stmt.getResultSet();
while (results.next())
{
String firstName = results.getString("aaa");
System.out.println("firstName" + firstName);
}
conn.close();
}
catch (Exception exc)
{
exc.printStackTrace();
}
}
}
|
看点入门的书,赶快开始做吧, mastingEJB2 很不错, 看了国内很多ejb的书都是翻译这本书的。