Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can test my FreeTDS JDBC Driver?

driver FreeTDS JDBC Test
0
Posted

How can test my FreeTDS JDBC Driver?

0

Rajkumar Seth offers the following: static void ftdsjdbc () { try { // use your hostname and port number here String url = “jdbc:freetds:sqlserver://nt1:1433/master”; String login = “sa”; // use your login here String password = “secret”; // use your password here if (false) { //Sybase url = “jdbc:freetds:sybase://unix1:4100/master”; login = “sa”; // use your login here password = “secret”; // use your password here } Class.forName(“com.internetcds.jdbc.tds.Driver”); //open a connection to the database Connection connection = DriverManager.getConnection(url, login, password); //to get the driver version DatabaseMetaData conMD = connection.getMetaData(); System.out.println(“Driver Name:\t” + conMD.getDriverName()); System.out.println(“Driver Version:\t” + conMD.getDriverVersion()); //create a statement Statement st = connection.createStatement(); //execute a query ResultSet rs = st.executeQuery(“SELECT * FROM master.dbo.sysprocesses”); // read the data and put it to the console while (r

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.