阿
阿军
Unregistered / Unconfirmed
GUEST, unregistred user!
import java.io.*;
import java.net.*;
import java.sql.*;
//import java.util.Vector;
public class sqlconn {
public static void main(String args[])
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//连接数据库
Connection c=DriverManager.getConnection("jdbcdbc:javaicq","sa","system");
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("select * from test1");
System.out.print(rs.getString(1));
}
catch(Exception e){e.getMessage();}
}
}
import java.net.*;
import java.sql.*;
//import java.util.Vector;
public class sqlconn {
public static void main(String args[])
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//连接数据库
Connection c=DriverManager.getConnection("jdbcdbc:javaicq","sa","system");
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("select * from test1");
System.out.print(rs.getString(1));
}
catch(Exception e){e.getMessage();}
}
}