Subject | JCA DOESN'T WORK - sample code |
---|---|
Author | Sanjay Amatya |
Post date | 2002-04-24T12:33:06Z |
Here's the code roman:
import java.sql.*;
public class TestFireBird {
public static void main(String[] args) {
Connection connection = null;
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
connection =
DriverManager.getConnection("jdbc:firebirdsql:amatya:c:\\testjava\\contact.gdb","sysdba","masterkey");
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("select * from tblcat;");
while (rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
connection.close();
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
}
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
import java.sql.*;
public class TestFireBird {
public static void main(String[] args) {
Connection connection = null;
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
connection =
DriverManager.getConnection("jdbc:firebirdsql:amatya:c:\\testjava\\contact.gdb","sysdba","masterkey");
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("select * from tblcat;");
while (rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
connection.close();
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
}
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/