Invalid Select :[IBM][SQLServer JDBC Driver]

M

mareluad

Hello,

I want to try to make the next class:

/*
* Created on Feb 17, 2006
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package pagecode;
import java.sql.*;

/**
* @author sbratest
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/

public class get_warehousedescription {
public static void main(String[] args) {
Connection connection = null ;{
try {
String driverName =
"com.ibm.websphere.jdbc.sqlserver.SQLServerDriver"; // NetDirect JDBC
driver
String url =
"jdbc:ibm:sqlserver://wyctst217:1433;SelectMethod=cursor;DatabaseName=TEST";
String username = "test";
String password = "test";

//jdbc:microsoft:sqlserver:wyc222\bkupexec:1433;User=support;Password=support
// Load the JDBC driver
Class.forName(driverName);

// Create a connection to the database
connection = DriverManager.getConnection(url, username,
password);
} catch (ClassNotFoundException e) {
// Could not find the database driver
System.out.println("Invalid Driver :"+e.getMessage());
} catch (SQLException ee) {
// Could not connect to the database
System.out.println("Invalid Database :"+ee.getMessage());
}


try {
// Create a result set containing all data from my_table
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT testid FROM
meetmonster");

// Fetch each row from the result set
while (rs.next()) {
// Get the data from the row using the column index
String s = rs.getString(1);

// Get the data from the row using the column name
s = rs.getString("testid");
System.out.println(s);
}
} catch (SQLException eee) {
System.out.println("Invalid Select :"+eee.getMessage());
}
}
}

}


But I get the next error:
Invalid Select :[IBM][SQLServer JDBC Driver]This driver is locked for
use with embedded applications.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top