itpragmatic
New Member
Experts,
I am newbie in Progress database. I am retrieving data contents from database using a java code. Following is my code.
I am able to see the result when I use localhost. String url = "jdbc:jdbcprogress:T:localhost:2500:sports2000";
If I want to retrieve it using ip address, how could I do this? I tried with several options.
String url = "jdbc:jdbcprogress:T:192.168.1.12:2500:sports2000"; or
String url = "jdbc:jdbcprogress:T:'192.168.1.12':2500:sports2000";
None of them works. Also note I am including all the jar files correctly. e.g. progress.jar and jdbc.jar. command is
java -cp .;progress.jar;jdbc.jar JDBCDemo
this is working fine for the localhost. There is no error in the command or in jar inclusion.
If i want to access the same code from different machine, I am just replacing localhost by corresponding IP address for the time being. The other machine does not have progress installed on it. What should be done in order to get this right? please help.
I am getting following error.
Exception is.....java.sql.SQLException: No suitable driver found for jdbc:jdbcpr
ogress:T:'192.168.1.12':2500:sports2000
Please suggest your ideas/suggestions.
Thanks in advance.
I am newbie in Progress database. I am retrieving data contents from database using a java code. Following is my code.
Code:
import java.sql.*;
import java.io.*;
import java.net.URL;
public class JDBCDemo
{
Connection con; // Connection object
public JDBCDemo()
{
}
public void getConnection()
{
try
{
String drivername="com.progress.sql.jdbc.JdbcProgressDriver";
Class.forName(drivername);
System.out.println ("Class Found...");
String url = "jdbc:jdbcprogress:T:localhost:2500:sports2000";
System.out.println ("This is driver...");
con = DriverManager.getConnection(url,"sysprogress","sysprogress"); System.out.println ("this is getconnection...");
Statement stmt = con.createStatement();
System.out.println ("Class Found1...");
String query = "Select * from pub.Customer";
System.out.println ("Class Found2...");
ResultSet rs = stmt.executeQuery(query);
while(rs.next())
{
System.out.println("Num :" + rs.getString("CustNum"));
System.out.println("Name :" + rs.getString("Name") + "\n");
}
}
catch(Exception e)
{
System.out.println("Exception is....."+e);
}
}
public static void main(String args[])
{
JDBCDemo obj = new JDBCDemo(); // object of JDBCDemo is created here
obj.getConnection();
}
}
If I want to retrieve it using ip address, how could I do this? I tried with several options.
String url = "jdbc:jdbcprogress:T:192.168.1.12:2500:sports2000"; or
String url = "jdbc:jdbcprogress:T:'192.168.1.12':2500:sports2000";
None of them works. Also note I am including all the jar files correctly. e.g. progress.jar and jdbc.jar. command is
java -cp .;progress.jar;jdbc.jar JDBCDemo
this is working fine for the localhost. There is no error in the command or in jar inclusion.
If i want to access the same code from different machine, I am just replacing localhost by corresponding IP address for the time being. The other machine does not have progress installed on it. What should be done in order to get this right? please help.
I am getting following error.
Exception is.....java.sql.SQLException: No suitable driver found for jdbc:jdbcpr
ogress:T:'192.168.1.12':2500:sports2000
Please suggest your ideas/suggestions.
Thanks in advance.