GeeCON Prague 2014*
The moose likes JDBC and the fly likes Connection Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Problem" Watch "Connection Problem" New topic
Author

Connection Problem

Rajeev Asthana
Ranch Hand

Joined: Oct 27, 2003
Posts: 43
I have created a database DEV and its URL is: jdbc ointBase EV.

I then added pbembedded.jar in CLASSPATH Suffix in JVM tab in Admin Console.

I also created a JNDI entry as jdbc/dev.

Then I created a table USER_SALARY in the schema PBPUBLIC.

I want to use the table in my Session Bean to insert rows in this table.

I specified it as:

...
ds = (DataSource)ctx.lookup("jdbc/dev");
conn = ds.getConnection();
pstmt = conn.prepareStatement("INSERT INTO PBPUBLIC.USER_SALARY (USER_NAME, SALARY) VALUES(?,?)");

pstmt.setString(1, userName);
pstmt.setDouble(2, (initialSalary*1.25));


updatecount = pstmt.executeUpdate();

.....

When I run the programs, I see that there is an error message in the server.log file:
"....table USER_SALARY is not found...."

What could be the error?

Any help is appreciated.

Thanks,
Rajeev.
Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60
Try creating a synonym on the object and granting insert right to it...


Jyothi<br />Sun Certified Java Programmer<br />Brainbench Certified for Javascript
Rajeev Asthana
Ranch Hand

Joined: Oct 27, 2003
Posts: 43
Originally posted by Jyothi Lature:
Try creating a synonym on the object and granting insert right to it...


I was trying all this in J2EE 1.4 SDK. I thought it'll take care of it.
Thanks for the suggestion.
 
GeeCON Prague 2014
 
subject: Connection Problem