JDBC/SQL Question

910 byte By smiles78a at 2007-11-27 9:47:28
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 ...

PreparedStatement hangs

860 byte By black_lotusa at 2007-11-27 9:47:58
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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; ...

Byte encoding

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) ...

Exception while executing PreparedStatement

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) ...

How to connect to Oracle from jsp page in eclipse

509 byte By Sudipthaa at 2007-11-27 9:48:54
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 ...

How to create datasource object ..?

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...

How to connect to Oracle from jsp page in eclipse

509 byte By Sudipthaa at 2007-11-27 9:50:05
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 ...

JDBC connection to derby from an applet

1122 byte By kbrammer73a at 2007-11-27 9:50:06
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 ...

Get The Database Name

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

Error in connecting the database with context.xml resource

467 byte By senthil_yogaa at 2007-11-27 9:51:37
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 ...

Can I create Oracle Database using Java ?

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... ?

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

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 ...

how to connect to the mysql database using applet from remote PC

558 byte By uttam_virusa at 2007-11-27 9:53:09
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" ...

how to connect to the mysql database using applet from remote PC

558 byte By uttam_virusa at 2007-11-27 9:53:10
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" ...

this is my code

1666 byte By uttam_virusa at 2007-11-27 9:53:13
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 = ...

SQL Data import

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 ...

Failed to RowUpdate to 2 different tables simultaneously

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 ...

textarea to CLOB/BLOB (not an obvious question at all)

1173 byte By bamkin-ov-lestaa at 2007-11-27 9:54:33
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 ...

Returning datatype

576 byte By Saurabn84a at 2007-11-27 9:54:47
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 ...

Derby and boolean values

84 byte By malino01a at 2007-11-27 9:55:01
does anyone have any information to help me use boolean/bit datatype in Derby

unable to add oracle driver connection

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 ...

How to read and write from excel file WithOUT using JDBC

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

Zero rows returned with JdbcOdbcDriver to MS Sql 2000

1566 byte By ebassadora at 2007-11-27 9:57:05
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, ...

How to create an Oracle DATABASE through Java Programming Language.. ?

77 byte By Shebua at 2007-11-27 9:58:38
How to create an Oracle DATABASE through Java Programming Language.. ?

What is JDBC Connection Pooling... ?

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 ?

How to create JDBC connecin using Datasource ..?

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.

adding TIMESTAMP

845 byte By haggard17a at 2007-11-27 10:00:32
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 ...

Another stupid security problem.

1294 byte By apchar_boiira at 2007-11-27 10:01:33
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 ...

help java connection problem!!!!!

49 byte By lesbona at 2007-11-27 10:01:58
how to connect a jcomobobox to a database?

Java and MS SQL Server 2000 problem, please help

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(); ...

Connecting JAVA to Oracle?

654 byte By Parag_Kalraa at 2007-11-27 10:02:22
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 ...

ResultSet Paging

332 byte By jotnartaa at 2007-11-27 10:02:36
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 ...

mysql, jdbc, tomcat, jsp...

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 ...

client machine cannot access the database server using jdbc

496 byte By Mr.VijayDesai@OPSPLa at 2007-11-27 10:03:03
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 ...

Group By Problem

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 ...

logging tool for JDBC (offtopic maybe ?)

1615 byte By sorin7486a at 2007-11-27 10:04:32
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 ...

Count(*) returns 'Column 'Count' not found' SQLException

494 byte By Hitokiria at 2007-11-27 10:05:05
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 ...

Query in Java App taking a very long time

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 ...

Database design to avoid duplicated field without making it as primary key

1355 byte By KwangHooia at 2007-11-27 10:10:06
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 ...

Remote machine cannot access the database using JDBC

414 byte By Mr.VijayDesai@OPSPLa at 2007-11-27 10:10:23
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 ...

Object Relational Mapping

288 byte By yogeshjoshijia at 2007-11-27 10:10:46
<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>

Reusing PreparedStatments

1647 byte By pontus.ullgrena at 2007-11-27 10:11:44
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 ...

Checking username against a database

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 ...

Use Multiple Insert Statements in Prepared Statements

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 ...

Of the 4 Drviers available for the JDBC which one follows single ton design

147 byte By SreenathReddya at 2007-11-27 10:14:29
<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>

Updating a table via a gui program

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 ...

Problems with SQL Server please help.

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 = ...

Problems with SQL Server please help.

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 ...

which is better to use? connection.close() or connection = null

1055 byte By myScreen@ArunNavadaa at 2007-11-27 10:16:46
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 ...

Datetime in SQL

84 byte By sunensisa at 2007-11-27 10:17:13
<p>How do i convert a datetime from java interface and submit into SQL database?</p>