Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

jdbc problem

Thread view: 
dgfgrdg - 16 May 2006 03:59 GMT
I have the following code that just hangs I left it for 5 Minutes and
nothing had happen any ideas?

I left out the full url, usename and password of the connect for security
but its correct.
url is  jdbc:oracle:thin:....;

DatabaseConnection dbc= new DatabaseConnection();
String str= "INSERT INTO Member(username, password, fname, sname, address,
phone) VALUES ('gdavie', 'a', 'glen', davie', 'home', '12345678')";
dbc.runUpdate(str);

code for runUpdate

public void runUpdate(String sql) throws SQLException
{
  Statement statement = conn.createStatement();
   statement.execute(sql);
}

schema

CREATE TABLE Member
(
username varchar(30) primary key,
password varchar(30),
fname varchar(30),
sname varchar(30),
address varchar(50),
phone varchar(10)
);
satish.kakumani@gmail.com - 16 May 2006 04:50 GMT
Try to ping the server if you can able to connect to the database
server....
Make sure you give the correct port as database server

test ping databaseserver from the command prompt..
dgfgrdg - 16 May 2006 04:53 GMT
The Database server works I can connect using sqlplus and the web interface.
Andy Flowers - 16 May 2006 18:54 GMT
> The Database server works I can connect using sqlplus and the web interface.

What happens if you run the same insert code from SQL*Plus ?
If this runs then it isolates the problem to the Java code, if not then it
isolates it to the database.

Are there any triggers associated with the table ?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.