Does your database server restrict multiple connections? Toplink would
try to pool connections. Thats the only difference I can think of
glassfish_at_javadesktop.org wrote:
> But there must be a difference, because in the same project, with the same settings, the same classpath, this code works:
>
> public final void testConnection() {
> Connection con = null;
> PreparedStatement pstmt = null;
> ResultSet res = null;
>
> String statement = "select * from Table1";
>
> try {
> Class.forName("net.sourceforge.jtds.jdbc.Driver");
> con = DriverManager.getConnection("jdbc:jtds:sqlserver://dbserver.xyz.uvw.de:1433/DATABASENAME", "my_username", "my_password");
> pstmt = con.prepareStatement(statement);
> res = pstmt.executeQuery();
>
> while (res.next()) {
> System.out.println(counter + ": " + res.getObject(1));
> }
> ...
> [Message sent by forum member 'jiai' (jiai)]
>
> http://forums.java.net/jive/thread.jspa?messageID=293282
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>