3个回答
2013-08-26
展开全部
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url = "jdbc:oracle:@localhost:1521:orcl";
String user = "sa";
String password = "123456";
Connection conn = DriverManager.getConnection(url,user,password);
String url = "jdbc:oracle:@localhost:1521:orcl";
String user = "sa";
String password = "123456";
Connection conn = DriverManager.getConnection(url,user,password);
2013-08-26
展开全部
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class OraclTest
{
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//oracle IP地址+端口号/recruit
String url = "jdbc:oracle:thin:@192.168.8.19:1521:recruit";
Connection con = DriverManager.getConnection(url,"username","password");
con.close();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class OraclTest
{
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//oracle IP地址+端口号/recruit
String url = "jdbc:oracle:thin:@192.168.8.19:1521:recruit";
Connection con = DriverManager.getConnection(url,"username","password");
con.close();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-26
展开全部
c = DriverManager.getConnection("jdbc:oracle:thin:@10.23.45.67:1521:agent","username","password");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询