Java for Jbase
- Valleyman1
- Topic Author
- Visitor
-
13 years 3 months ago #10753
by Valleyman1
Java for Jbase was created by Valleyman1
Am running R10 on windows.Am want to develop java applications for jbase. Am getting the following error when i try to connect to jbase using netbeans IDE.Exception in thread "main" java.sql.SQLException: No suitable driver found.How do i set the class path so that the following error will be resolved.
Please Log in or Create an account to join the conversation.
- saahmad
- Offline
- Premium Member
-
Less
More
- Posts: 145
- Thank you received: 9
13 years 3 months ago #10754
by saahmad
Replied by saahmad on topic Re: Java for Jbase
it simple, goto Libraries, select the jar file that is the jbase library (usually on the jbase path).
Please Log in or Create an account to join the conversation.
- Valleyman1
- Topic Author
- Visitor
-
13 years 3 months ago #10757
by Valleyman1
Replied by Valleyman1 on topic Re: Java for Jbase
the jbasejdbc.jar file i have put the path to it on env variables on mycomputer.that is where am getting the error.So i need to know where should i put my classpath for it to work.
Please Log in or Create an account to join the conversation.
- saahmad
- Offline
- Premium Member
-
Less
More
- Posts: 145
- Thank you received: 9
13 years 3 months ago #10783
by saahmad
Replied by saahmad on topic Re: Java for Jbase
is the netbeans running on the same computer as JBase?
if yes then you need to add the whole jbase folder e.g. ..../jbase526/java/lib
if no then copy the whole folder to your local PC.
if yes then you need to add the whole jbase folder e.g. ..../jbase526/java/lib
if no then copy the whole folder to your local PC.
Please Log in or Create an account to join the conversation.
- Valleyman1
- Topic Author
- Visitor
-
13 years 3 months ago - 13 years 3 months ago #10789
by Valleyman1
Replied by Valleyman1 on topic Re: Java for Jbase
i have added the following in jbase_env
@rem Script to set environment variables for jBASE 5.0
set CLASSPATH=C:\jbase5\5.0\java\lib
but its not working still giving the same err
the java code is:
import java.sql.*;
import java.io.*;
public class Tete {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
Class.forName("com.jbase.jdbc.driver.JBaseJDBCDriver");
} catch (Exception e) {
System.out.println(e);
}
try {
Connection con = DriverManager.getConnection("jdbc:jbasejo:thin:@localhost:3570:MYACCOUNT", "t24", "123456");
} catch (Exception e) {
System.out.println(e);
}
}
}
@rem Script to set environment variables for jBASE 5.0
set CLASSPATH=C:\jbase5\5.0\java\lib
but its not working still giving the same err
the java code is:
import java.sql.*;
import java.io.*;
public class Tete {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
Class.forName("com.jbase.jdbc.driver.JBaseJDBCDriver");
} catch (Exception e) {
System.out.println(e);
}
try {
Connection con = DriverManager.getConnection("jdbc:jbasejo:thin:@localhost:3570:MYACCOUNT", "t24", "123456");
} catch (Exception e) {
System.out.println(e);
}
}
}
Last edit: 13 years 3 months ago by Valleyman1. Reason: adding java code
Please Log in or Create an account to join the conversation.
- johnperez
- Visitor
-
13 years 3 months ago - 13 years 3 months ago #10837
by johnperez
Replied by johnperez on topic Re: Java for Jbase
Find attached a netbeans example. This is on R10, with Windows XP and Java 1.6
don't forget to start jbase_agent
Rgds
don't forget to start jbase_agent
Rgds
Last edit: 13 years 3 months ago by johnperez.
Please Log in or Create an account to join the conversation.
- Valleyman1
- Topic Author
- Visitor
-
13 years 3 months ago #10857
by Valleyman1
Replied by Valleyman1 on topic Re: Java for Jbase
Am getting the following error when i run the program.
run:
..........................
Err Code: 0 SQL State: null mesg: ERROR in connecting to host [127.0.0.1]:[3750] Connection refused: connect
..........................
java.sql.SQLException: ERROR in connecting to host [127.0.0.1]:[3750] Connection refused: connect
at com.jbase.jdbc.JBaseJDBCSocketConnection.doConnection(Unknown Source)
at com.jbase.jdbc.driver.JBaseJDBCDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at jdbc_jbase.Main.main(Main.java:30)
BUILD SUCCESSFUL (total time: 2 seconds)
run:
..........................
Err Code: 0 SQL State: null mesg: ERROR in connecting to host [127.0.0.1]:[3750] Connection refused: connect
..........................
java.sql.SQLException: ERROR in connecting to host [127.0.0.1]:[3750] Connection refused: connect
at com.jbase.jdbc.JBaseJDBCSocketConnection.doConnection(Unknown Source)
at com.jbase.jdbc.driver.JBaseJDBCDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at jdbc_jbase.Main.main(Main.java:30)
BUILD SUCCESSFUL (total time: 2 seconds)
Please Log in or Create an account to join the conversation.
- johnperez
- Visitor
-
13 years 3 months ago #10866
by johnperez
Replied by johnperez on topic Re: Java for Jbase
as I said before, don't forget to start jbase agent on port 3750 (thats the port showed on the error message)
Please Log in or Create an account to join the conversation.
- Valleyman1
- Topic Author
- Visitor
-
13 years 2 months ago #11154
by Valleyman1
Replied by Valleyman1 on topic Re: Java for Jbase
the following error is showing on the agent:
C:\ModelBank_R10GA\ModelBank_R10GA>cd Temenos\bnk\bnk.run
(9792|4000) NOTICE starting up jAgent, Process Per Connection mode, listening on
port 9494, c:\src\tafc\r10\jagent\SocketAcceptor.h +107
(7348|10900) NOTICE RequestHandlerService::open: connected with VALL-HP, RequestHandlerService.cpp +221
(7348|10900) ERROR Client::authenticate:Client did not authenticate. Closing jag
ent connection., Client.cpp +236
(7348|10900) NOTICE Closing connection to VALL-HP, RequestHandlerS
ervice.cpp +127
(7348|10900) NOTICE Shutting down Connection, JAgentSocketServer.cpp +115
(9792|5708) NOTICE PID 7348 exited., WorkerProcess.cpp +102
when i run the progam on port 9494.
C:\ModelBank_R10GA\ModelBank_R10GA>cd Temenos\bnk\bnk.run
(9792|4000) NOTICE starting up jAgent, Process Per Connection mode, listening on
port 9494, c:\src\tafc\r10\jagent\SocketAcceptor.h +107
(7348|10900) NOTICE RequestHandlerService::open: connected with VALL-HP, RequestHandlerService.cpp +221
(7348|10900) ERROR Client::authenticate:Client did not authenticate. Closing jag
ent connection., Client.cpp +236
(7348|10900) NOTICE Closing connection to VALL-HP, RequestHandlerS
ervice.cpp +127
(7348|10900) NOTICE Shutting down Connection, JAgentSocketServer.cpp +115
(9792|5708) NOTICE PID 7348 exited., WorkerProcess.cpp +102
when i run the progam on port 9494.
Please Log in or Create an account to join the conversation.
- Teejay
- Visitor
-
12 years 9 months ago #12559
by Teejay
Replied by Teejay on topic Re: Java for Jbase
This worked, thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.045 seconds