当前位置: 技术问答>java相关
新手送分,簡單的Jdbc問題
来源: 互联网 发布时间:2015-04-29
本文导语: import java.util.Properties; import java.sql.*; import java.io.*; public class Making { public static void main(String args[]) { String driverName = "sum.jdbc.odbc.JdbcOdbcDriver"; String sourceURL = "jdbc.odbc:ASA 6.0 Sample"; try { Class.forName(d...
import java.util.Properties;
import java.sql.*;
import java.io.*;
public class Making
{
public static void main(String args[])
{
String driverName = "sum.jdbc.odbc.JdbcOdbcDriver";
String sourceURL = "jdbc.odbc:ASA 6.0 Sample";
try
{
Class.forName(driverName);
Properties prop = new Properties();
prop.setProperty("user","dba");
prop.setProperty("password","sql");
Connection databaseConnection = DriverManager.getConnection(sourceURL,prop);
}
catch(ClassNotFoundException cnfe)
{
System.err.println("Error loading " + driverName);
}
catch(SQLException sqle)
{
System.err.println(sqle);
}
}
}
java Making 時出錯"Error loading sum.jdbc.odbc.JdbcOdbcDriver",請各位幫忙
import java.sql.*;
import java.io.*;
public class Making
{
public static void main(String args[])
{
String driverName = "sum.jdbc.odbc.JdbcOdbcDriver";
String sourceURL = "jdbc.odbc:ASA 6.0 Sample";
try
{
Class.forName(driverName);
Properties prop = new Properties();
prop.setProperty("user","dba");
prop.setProperty("password","sql");
Connection databaseConnection = DriverManager.getConnection(sourceURL,prop);
}
catch(ClassNotFoundException cnfe)
{
System.err.println("Error loading " + driverName);
}
catch(SQLException sqle)
{
System.err.println(sqle);
}
}
}
java Making 時出錯"Error loading sum.jdbc.odbc.JdbcOdbcDriver",請各位幫忙
|
String driverName = "sum.jdbc.odbc.JdbcOdbcDriver";
改为:
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
改为:
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";