Hi,
here is an example to test
connection.
Remember to modify username, password, hostname,
dbname.
Good work.
Pier Paolo.
import java.sql.*;
import
java.util.*;
public class MSSQLServerTestConnection
{
/**/
static String username = "xxxxxxx";
static String
password = "xxxxxxx";
static String thinConn =
"jdbc:freetds:sqlserver://hostname/dbname";
static
String driverClass = "com.internetcds.jdbc.tds.Driver";
/**/
public static Connection
getConnection() throws SQLException {
Connection cn = null;
try
{
Driver
d =
(Driver)Class.forName(driverClass).newInstance();
cn = DriverManager.getConnection(thinConn,username,password);
return cn;
}
catch
(Exception e)
{
e.printStackTrace(System.out);
throw new SQLException("Error Loading JDBC
Driver");
}
}
public
static void main(String argv[]) {
try
{
Connection conn = getConnection();
if (conn == null)
{
System.out.println("Connessione
nulla!!!");
System.exit(0);
}
else
{
boolean b =
conn.getAutoCommit();
System.out.println("Connessione
riuscita!!!");
System.out.println("AutoCommit " +
b);
}
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
----- Original Message -----
Sent: Monday, December 11, 2000 4:20
PM
Subject: [freetds] JDBC Connection
string?
Hi, I'm using FreeTDS JDBC-Driver to connect to a MS
SQL-Server 7 DB, but
have one question:
What's the format of the
connection string "jdbc:freetds...something"
?
Thank's.
/Daniel
---
You are currently subscribed
to freetds as: [pierpaolo.bortone AT netengineering.it]
To
unsubscribe, forward this message to leave-freetds-121965M AT franklin.oit.unc.edu
---
You
are currently subscribed to freetds as: [daniel.selin AT home.se]
To
unsubscribe, forward this message to
$subst('Email.Unsub')