Sat Apr 07, 2007 2:59 pm
Telnet localhost portnumber
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("Driver Exits !!!");
connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://computer_name:port","username","password");
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
catch (SQLException ex) {
ex.printStackTrace();
}
Fri Jun 08, 2007 12:50 am
Fri Jun 08, 2007 10:42 am
Xline wrote:Thanks for Code
as JDK1.6 no need for Class.forName(..etc)
Class.forName("com.mysql.jdbc.Driver").newInstance();
Class.forName("org.postgresql.Driver").newInstance();
Mon Jun 18, 2007 12:56 am
Import java.sql.*;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection("jdbc:odbc:WSD");
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery("SELECT * from student");
statement.execute("insert into student values (1,12)");
}
catch (Exception e)
{
}
result.getString("here you put the columns index you want to get its value"); // 1 as an example
Mon Jun 18, 2007 5:38 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.