T
tonvy
Unregistered / Unconfirmed
GUEST, unregistred user!
public static Connection getConnection() throws SQLException
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbcracle:thin192.168.1.150:1521:byzh";
String user="ysxt";
String psw="ysxt";
Connection conn= DriverManager.getConnection(url,user,psw);
}
catch(Exception e)
{
return(conn);
}
return(conn);
}
我想返回conn,但我编译的时候说我return(conn)有错误
提示如下:cannot resolve symbol
symbol : variable conn
请问各位前辈我应该如何更改才能正确返回conn,谢谢您了
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbcracle:thin192.168.1.150:1521:byzh";
String user="ysxt";
String psw="ysxt";
Connection conn= DriverManager.getConnection(url,user,psw);
}
catch(Exception e)
{
return(conn);
}
return(conn);
}
我想返回conn,但我编译的时候说我return(conn)有错误
提示如下:cannot resolve symbol
symbol : variable conn
请问各位前辈我应该如何更改才能正确返回conn,谢谢您了