I have to use straight JDBC, SQL, not fancy bean mapping tools -- it's not my call. Would be nice, but anyways........I have several tables which are linked together by one unique key ID. There is a many-to-one relationship. If this were objects it would transaction to one Java Object ...
I'm trying to transfer table data from one database to another - 95,000 records. Upon calling the first executeUpdate() of my PreparedStatement my program hangs. How can I debug this? String insert = "INSERT INTO TABLE2(...) "+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; ...
631 byte By
msduk_a at 2007-11-27 9:48:20
Hi I am trying to do something a little strange but it is necessary.I am writing out SQL as in a .sql text file so that I can run it on a few servers. One of the fields is a jpg image that I am trying to insert into a MEDIUMBLOB. The line will end up being -:insert into fileBlob(fileId, data) ...
729 byte By
HMMa at 2007-11-27 9:48:40
I am getting java.sql.Exception: Fail to convert to internal representation error when trying to execute following statement:Connection conn = null;PreparedStatement stmt = null;try {conn = bean.getDataSource().getConnection();stmt = conn.prepareStatement((String) ...
Hello All,I am having a webapplication that uses jsp as front end and oracle as the backend. I am using Eclipse as my development platform with Tomcat as the App Server. My Jsp works fine. I need to connect to the Oracle database installed locally in my system. What are the steps that need to ...
188 byte By
Shebua at 2007-11-27 9:50:04
Can any one tell how to create database connection using Datasource object... ? If possible giveing exapomle/code for it.. to connect my applicatin with oracle... ? thanks...
Hello All,I am having a webapplication that uses jsp as front end and oracle as the backend. I am using Eclipse as my development platform with Tomcat as the App Server. My Jsp works fine. I need to connect to the Oracle database installed locally in my system. What are the steps that need to ...
I'm doing the JDBC tutorial at java.sun.comEverything runs fine from the Netbeans IDE. I'm not sure whether the applet is supposed to work inside the IDE or not, I figure that's meant for the web.Within Netbeans, the following URL works:String url = "jdbc:derby:C:\\Documents and ...
111 byte By
zetaa at 2007-11-27 9:51:30
I want to write a program which returns the database name from a connection object. How can this be done
Dear everyone,i am trying to connect the application with database...i have a table with employee id, name...i have given context xml and established connection..but i am getting error as* " Element type "Resource" must be followed by either attribute specifications, ">" or "/>"."* "The ...
137 byte By
Shebua at 2007-11-27 9:51:41
HI ...Can I create a Database using Java... ? If yes can any one tell me how ? I mean provide some codeing help... ?
1431 byte By
sh1010a at 2007-11-27 9:51:58
I am using Microsoft SQL Server 2000 Driver to connect to SQL Sever 2000 from a remote machine having Linux OS. But this is giving below error:javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.The Driver I am using is ...
Hii All..I am also facing a problem.My web server and mysql server are running on the same PC.when i connect to the database from the same PC.Its connection but when i am trying to connect to the database from the different PC its giving error and not finding the driver "com.mysql.jdbc.Driver" ...
Hii All..I am also facing a problem.My web server and mysql server are running on the same PC.when i connect to the database from the same PC.Its connection but when i am trying to connect to the database from the different PC its giving error and not finding the driver "com.mysql.jdbc.Driver" ...
public class test extends JApplet{public test() {}Connection conn = null;Statement stmt;boolean flag;public boolean connect(String url, String userName, String password){try{//Step:1System.out.println("JDBC Test" );Class.forName("com.mysql.jdbc.Driver").newInstance(); //Step:2conn = ...
553 byte By
ZarMusea at 2007-11-27 9:53:31
Hi,I'm developping an application wich import a lot of data into mydatabase.Todo this, there is a file which data and format like thatdata1|data2|data3 etc.I'm parsing line by line the current file and doing insert in thedatabase.It works fine with few datas but after 5000 lines approximately ...
1049 byte By
mortozaa at 2007-11-27 9:53:45
Hi there,I am trying to update two different tables from each other after some calculation (this is related to inventory cost calculation) while I am using a 3rd table to drive the loop. Unfortunately, the following exception is occured..Place 2o: transactionQty....>>>>:353975.0 ...
I am currently working on a problem whereby a form on the clientside (HTML page) POSTs the contents of a textarea to my servlet. The servlet then stores the content of the textarea into a BLOB. Quite simple sounding at first ... it seems that one would be required to directly process the ...
I am using the resultset and the metadata functions to get the column type from an EXCEL sheet. I use the getString(6) function in the resultset..which returns the data type..When the zips are arranged in random order..this retuens the column type as NUMBER which messes up the program...however ...
does anyone have any information to help me use boolean/bit datatype in Derby
559 byte By
jin412a at 2007-11-27 9:55:42
In new database connection.name:oracledriver:oracle.jdbc.driver.OracleDriverdtabase url:jdbc:oracle:thin:10.10.20.20:1521:testusername:testpasword:testafter that, i have error message;unable to add connection, cannot establish a connection to jdbc:oracle:thin:10.10.20.20:1521:test using oracle ...
251 byte By
A-KADRIa at 2007-11-27 9:56:46
HI ALL, I would like to know is there is a way to read and update an excel file that is on my PC WithOUT usinf JDBC. I'll be grateful for useful reply,Many thanks, A-KADRIMessage was edited by: A-KADRI
This code always returns 0 rows. There is plenty of data in the MS SQL 2000 Customers table.package DBTests;import javax.swing.*;//import javax.sql.*;import java.sql.*;import java.io.*;import java.lang.*;public class DBTests {public static void main(String[] args)//throws SQLException, ...
77 byte By
Shebua at 2007-11-27 9:58:38
How to create an Oracle DATABASE through Java Programming Language.. ?
87 byte By
Shebua at 2007-11-27 9:59:13
Can any one explain whta is JDBC Connection Pooling.. when, where and why used ?
126 byte By
Shebua at 2007-11-27 9:59:14
Can any one explain.. when where why and the mos impoortant of all how to create JDBC connection using Datasource APIs.
Hi,I am currently trying to add a timestamp+(variable) to my mssql database via a JSP. I can add the simple time stamp by doing the following:... PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+5)"); ......which adds 5 days to the current ...
The Problem: I'm trying to connect to my MySQL database. My connection is being refused but only in my java application.The Platform: Mandriva Linux + Apache + MySQL + jdk1.6.0 + connector/JEverything is running locally. The MySQL server is working and I have no trouble getting to it from PHP ...
49 byte By
lesbona at 2007-11-27 10:01:58
how to connect a jcomobobox to a database?
3300 byte By
Maba@ULa at 2007-11-27 10:02:20
please help me. I am using java and MS SQL Server 2000, and I'm trying to access and verify the login. I'm getting the following error message: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor IndexCan any please help in this regard. String userNumber = (String)userNumField.getValue(); ...
Hi Folks...I am an absolute newbie in JAVA....I have Windows Media Centre installed on my machine...Also I have Oracle 10g release 2 for the same....But I haven't installed it(oracle) yet....I have also not installed Java....First and foremost give me the link to download java so that I can ...
Hi AllAny one know how to can i page the results of Database ResultSet?, in ASP, you can use PageSize property, is there any property in JDBC?I am developing a small search program using JSP and Servlet, my resultsset retrieves almost 1000 records, and I do not want to dump them all in one ...
487 byte By
yekocana at 2007-11-27 10:02:38
hi,i am new in this topic.i have some simple questions:i use windows. i downloaded eclipse wtp, mysql 5.0.41, apache tomcat 6.0.13 and installed them all.what version of jdbc should i download and what are the steps for a working connection between jsp and mysql?what is the code that i should ...
hi everyone,i am having a problem that whenever I try to connect my applet application to my MySql databse using applet i am getting an error calledCannot connect to database servercom.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: But if i try to ...
4996 byte By
Pegga at 2007-11-27 10:03:59
Hello all,I have created some jsp pages that show relevant information from a database and pojo's and servlets that deal with the actual requests. I am connecting to a MS Access 2000 database. However, I am having trouble with one of my SELECT queries. The query in the code below works without ...
Hello,I would like to announce a nice little tool that I am involved in developing: it's called JDBC Logger. What this tool does is it wraps around an existing JDBC Driver and logs in plain text everything that passes throw (including prepared statements). For now we have a generic driver and ...
I am trying to get the count from a table using the following:String query = "SELECT COUNT(*) FROM myTable;"I know that the connection is open and working because I am getting back an SQLException:'Column 'Count' not found' .The same command works fine at the command line. I would be ...
1224 byte By
gubloooa at 2007-11-27 10:05:49
Hey Guys,I have this query shown below along with code. When I run it in Toad, it comes back in 2 seconds with about 15000 rows - but when I run it in Java app - it takes unusually long upto 9 mins for the same number of records.conn = getConnection();String query = "SELECT ...
During my database design, I have two tables (Product table and DatePrice table), withIn my ProductTableProduct ID / Product Name / Foreign Key to DatePrice tableIn my DatePriceTablePrimary ID/ Date/ PriceThe reasons to have the above table, is to record out the pricing of a product, which its ...
Hi everyonei am using a applet to connect to database which is called using a .html file with <APPLET> </APPLET> t ags,whenever i access this .html file from a remote machine i am getting a JDBC driver not found error.But if i access the same page from the server itself(which is my ...
<p>object relational mapping means to map relational database in Objects.</p><p>so any one can answer my query, why do we need mapping of Relational Database into Java Object. And this Java Object need persistence overhead also.</p><p>What are the Major benefits of using java object.</p>
Hello,Yet another question about PreparedStatments.I have a application that processes events and (depending on conditions) save them into a database.I have a Event class which represents the event.class Event {public int id;public String name;}And a DataStore which handles the SQL part. Since it ...
1272 byte By
suse69a at 2007-11-27 10:12:32
I want to do this, When the user input is processed, it will be checked against the database to see whats the role associated with the user. If the user is in the admin role, it will show Hello Admin on the second page.Using struts and mysql, I've got the jsp,Formbean ,but the mysql logic is ...
1191 byte By
vikenga at 2007-11-27 10:14:23
Hi Friendsi am stuck in a problem for which i need your help.i will brief you about the issue below.I am having Multiple Insert Statements which i need to execute to put the data in the database.i have a doubt about the use of the executeUpdate() function in the statement interface. sample code is ...
<p>hi!</p><p>I would like to know the which type of driver follows single ton design pattern of the four available drivers which are available.</p>
2433 byte By
raven147a at 2007-11-27 10:15:55
i am trying to update a record via the UPDATE function. My program has a show all button that brings in all the records. When i make a change in the record and click Update. I get the error: Syntax error in string in query expression ''00000' the zeroes represent an updated zipcode. Here is my ...
1813 byte By
Maba@ULa at 2007-11-27 10:16:23
I am trying to insert into SQL Server 2000 database and the following exception is thrown: [Microsoft][ODBC SQL Server Driver][SQL Server]Line1:Incorrect syntax near '@P1'M code is similar to the following:[code][ try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");java.sql.Connection connection = ...
2267 byte By
Maba@ULa at 2007-11-27 10:16:24
I sorry for the post posted before this one as I missed the code FormatI am trying to insert into SQL Server 2000 database and the following exception is thrown: [Microsoft][ODBC SQL Server Driver][SQL Server]Line1:Incorrect syntax near '@P1'M code is similar to the following: try ...
Hi,can anybody let me know what is the difference between the following statements when intended to end the usage of it?finally{try{if(con != null){con.close();}}catch(Exception e){System.out.println("Error in closing connection");}}ORfinally{con =null;}also can i set NULL to Resultset or Prepared ...
<p>How do i convert a datetime from java interface and submit into SQL database?</p>