Storing Date in MySQL database

1062 byte By Jensenryaa at 2007-11-27 8:35:08
Hello, I'm trying to store a datetime field in my SQL database.I did a little forum reading and decided to use a prepared statement.Code Snippet:java.util.Date givenJ=new java.util.Date();java.sql.Date given=new java.sql.Date(givenJ.getTime());PreparedStatement ...

Table name as paramter to PreparedStatement?

1293 byte By ajmasxa at 2007-11-27 8:35:42
Can a table name be provided as a parameter to a Prepared Statement? We are using Oracle 10 and have data stored in different schemas. The tables in each schema are identical, but depending on the customer querying the database we need to view the data in one schema or another. Follows is the ...

ClassNotFound problem in Resin

1046 byte By omnipotent1a at 2007-11-27 8:35:58
Hi all,I'm pretty new to this so please bear with me.I'm developing a web application (in Dreamweaver) using Ajax. I have a JSP script which is waiting for the request from the page to perform some operations on a database. It sends the page an error if any errors are encounteredI am always ...

mysql connector in linux - java.lang.ClassNotFoundException: com.mysql.jdbc

1195 byte By Victorqeda at 2007-11-27 8:36:54
I use mysql-connector-java-5.0.6-bin.jar and j2eesdk-1_4_03-linux.bin.I created a new directory: /usr/java/javaclass.The CLASSPATH variable point to this directory, where I copied the mysql-connector-java-5.0.6-bin.jar file.In the same directory I have the .java file that I test with.I compile ...

Restricting connection pool - server or client side

417 byte By dhaval_shaha at 2007-11-27 8:37:56
Not sure if my question is relevant to this forum but I'll give it a shot.I've deployed a web app on Tomcat and need to restrict the number of users connected to the database at any one time. I've looked at implementing a connection pool restriction client side but would this restriction ...

simple, fast db ?

342 byte By Dummasa at 2007-11-27 8:39:04
Hello, I'm writing some sort of program, witch must work fast with over 3k line records. I'm was interested in dll's, but this fing is win stuff, and I don't like win, so now I'm confused.. Like I want some sort of database, witch do not need to install, just like txt, o xml, but faster.. ...

how to retrieve data from the database

7959 byte By bakesa at 2007-11-27 8:39:54
the assignment i am working on is thisi have a table 'Employees" in the database with five columns(First Name, Surname, City, Country, SSN)i have designed a page "Mainpage" already with textfields to represent each of the columns in the table "Employees".I also have five buttons (Add, Delete, ...

connection pooling

829 byte By kal132a at 2007-11-27 8:40:00
Hi,I have a web app running on jboss and oracle as database. My app is basically a reporting app where I have many sql queries being called to get result from db.I am using JDBC connection pool to get and return connection from the pool just before and after each query.There will be about 45-50 ...

what are the needed tools for JDBC?

216 byte By aliaaa at 2007-11-27 8:40:34
iam new to this field, i want to know what are the required tools for JDBC?i know that i need java.sql and javax.sql packages, but how can i get them?what about the drivers?thnx in advance

Unexpected Transaction Behavior

1569 byte By mgrommeta at 2007-11-27 8:40:36
Its been a while since I've had the pleasure of doing serious work in Java, but I'm seeing something odd, and not sure how to work around it.I'm using:Oracle 10 ExpressWebsphere Community EdOracle 10 thin driversI've got a routine inserting into a table. There is a trigger and a sequence ...

Connector/J and Big file problem...

445 byte By amanjpro@yahoo.coma at 2007-11-27 8:41:36
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (2658422 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.this is what i'm facing when i want to upload big file (larger than 1048576 bits) can any one help me, how can i ...

Want to study Hibernate.

155 byte By OnlyForJavaa at 2007-11-27 8:41:54
Hi,allI want to study Hiberante.So which book is best for understanding Hibernate ?Or online Soure to start from scratch.Thanks

"Getting exception when trying to run a JDBC code"

290 byte By beejuma at 2007-11-27 8:42:01
Hi,I am getting this exception when I try to run the Jdbc code. Can some one sort out what is the problem.Exception in thread "main" java.lang.UnsupportedClassVersionError: TestJdbcGrip(Unsupported major.minor version 49.0)Regards

"Getting exception when i run a jdbc code"

234 byte By beejuma at 2007-11-27 8:42:09
Hi, I am getting this exception. Can anyone figure out what the problem is?Exception in thread "main" java.lang.UnsupportedClassVersionError: TestJdbcGrip(Unsupported major.minor version 49.0)Regards

error inserting into database

6740 byte By kc81a at 2007-11-27 8:42:38
need help,am tryin to insert data into my database which contains date,names,phone,address and deposit and it's giving this error message:java.lang.ClassCastException:java.util.Date cannot be cast to java.sql.Date.somebody help me please.thanks in advance.code:.....'\n'import ...

Find the difference between loading and registering the drivers..

285 byte By Deepak_TCSa at 2007-11-27 8:43:38
Dear Sir..Could you please help me to find the difference between two activities..1.Loading the drivers 2.Registering the driversWhat's the difference between loading and registeing the drivers and what activities take place by the JVM to do it all.

Can we be done loading driver and registering driver by Using 'new" Oper.

372 byte By Deepak_TCSa at 2007-11-27 8:43:45
Dear Sir..Can we directly create the instance of any driver class by using the "new" operator and by this object can we call any method like getConnection() etc,will it return connection instance.Is it necessary these all task from loading to registering the drivers all done by the help of ...

ora-01745

266 byte By srinivas_420_javaa at 2007-11-27 8:43:53
Hi I am working on entity beanswhile running the client program it is giving exception ora-01745 invalid host/bind namei am not aware ot this exceptioni created datasource and connection pool in weblogic serverplease help me

loading of multiple driver

374 byte By Rastoghaa at 2007-11-27 8:43:56
In a server class while loading the driver If I do - Class.forName("driver1");Class.forName("driver2");Where driver1 and driver2 are two different drivers like Sybase driver,or Oracle driver and both driver present .If I try to execute a simple SQl query ,which driver it will use ...

CLASSPATH for oracle.jdbc.driver.OracleDriver.class

430 byte By shivek.sachdeva at 2007-11-27 8:43:57
Trying to use JDBC Thin Driver, encountered the following exception during compilation:oracle.jdbc.driver.OracleDriver.class is not foundpoints to: DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());i'm assuming that it has something to do with the CLASSPATH,how do i set the ...

Caching Result Set ?

298 byte By kmathewma at 2007-11-27 8:47:34
folksI have a search page which returns a result set and the results are put in the session to be able to access when user clicks on the page numbers(pagination) in the results pane. Is there any way we can store or cache this and access instead of fetching it off the

Apostrophe not showing in Form input value

2259 byte By Evergreana at 2007-11-27 8:48:21
I have a JavaBean working great with Oracle 9i database using Tomcat 4.1.3 container where it shows Database values in a JSP update page that has a form for updating record information. The only issue is when I pull up in a JSP update form page where the field values are shown in the form input ...

What And where is the use of shift operator?

164 byte By Deepak_TCSa at 2007-11-27 8:49:09
Dear Sir,What is the use of shift Operator("<<",">>","<<<"),which API is using shift operator?please help me clear this question.

CreateCoffees.java

1606 byte By TugoSa at 2007-11-27 8:50:16
Hi,I am trying to execute the file which is in api document in http://java.sun.com/products/jdbc/book.html/* * Copyright 2003 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * Use of this software is authorized pursuant to the terms of the license found at * ...

Connect to Password Protected Access Database without creating DSN Object

1206 byte By Coffee_Junkiea at 2007-11-27 8:51:05
Hi, I am having some difficulty connecting to a password protected Access 2003 Database.I no don抰 want to create a static DSN object and have found some help in this area in the forums, but I cannot get it to work for me ;-(My original code (before I password protected the database) worked and ...

Inserting data from jsp form to multiple tables !

397 byte By khan_vu2007a at 2007-11-27 8:51:08
Hi,I want to insert data from jsp form to two tables tables are (1)FormformId (PK)deptName (2)Data formId (FK) sNo description itemCodeand the problem is that i want to save information form a jsp form to above two tables and i have only one form.so how do i insert data from a jsp form to ...

Error on Connection

2647 byte By River_Platea at 2007-11-27 8:52:14
Hello allI have this nice chunk of code that is trying to connect to a database named Prueba. it compiles just fine, but it wont work properly.. here's the code.package prueba;import java.sql.*;/** * * @author Administrator */public class TestCon {public static void main(String ...

OutOfMemoryError while trying to read a huge table

444 byte By Maaartina at 2007-11-27 8:54:05
I do a simple thing likeSELECT id, name FROM myHugeTable ORDER by namewithout any WHERE clause since I need to process the whole table somehow and get an OutOfMemoryError.I see no reason for it, as I do not need all the data at once, so I would expect JDBC to give it to me one row after the ...

JDBC OSX 10.4 classpath and xcode

692 byte By m3the01a at 2007-11-27 8:55:08
Here is my classpathecho $CLASSPATH/Users/m3the01/oracle/jdbc/lib/classes111.zip:/Users/m3the01/oracle/jdbc/lib/nls_charset11.zipIm getting the oracle.jdbc.driver.oracledriver errorAny tips on adding the drivers to xcode would also be appreciated.I attempt to build byjavac -classpath $CLASSPATH ...

Connection string issues to SQL Server

1445 byte By Piersa at 2007-11-27 8:55:14
Hey guys, I've been using these forums as a great reference for awhile and now I'm stumped and in need of a hand.So I'm writing a web app and need to connect to a SQL Server db, here is what I've created from the Java side of ...

How do I call DTS Package from java

201 byte By palthia at 2007-11-27 8:57:10
Actually I have .dts file, I want to call that file from java and execute it. This is typical requirement in my project. could any body can help me plzzzzzzzzz..Thanks in advance..

Connecting to my sql

141 byte By vijay.mandaa at 2007-11-27 8:59:01
Hello,Can anyone give me the code to connect to My SQL from JavaScript. I am using Javascript in ASP.Thanks,Vijay

SQLException Parameter Type Conflict

849 byte By rallapallia at 2007-11-27 8:59:25
Hi All,I have one stored procedure with 9 in parameters and 1 out parameter. Out of the 9 In parameters, 7 are veachar in oracle, and the remining 2 are NUMBER(5), NUMBER(10). I am setting like this.cs.setString() for 7 parameterscs.setLong() for 7 parametersIn oracle the OUT parameter was ...

problem for using query in netbeans

376 byte By Sreeram_MPa at 2007-11-27 8:59:29
hello friends, i created a database using mysql(5.0.33) in XAMPP. I am using netbeans5.5 and i got the connection to the database successfully and can query well using SQL command. the problem is that i can't use the query to insert the data from the databse to a combobox or textfield in the ...

how to Connect JDataStore database

135 byte By jawadaha at 2007-11-27 8:59:31
Hi I want to use JDataStore with Application how and where can i get it driver and how to use.Thanks for the help.

Returning Resultset from different DB

1567 byte By bhomiaa at 2007-11-27 8:59:46
Hi folks,I am working on a developing a Database Framework. The user gives information about the stored proc to execute,parameters required by the stored prc, the connection url ,credentials and database provider(which can be Oracle,SQL Server or DB2). I have to execute the query and return ...

JDBC and Oracle data type error.. please help

810 byte By Zamiela at 2007-11-27 9:00:12
Im having trouble with a SQL query of mine. Im trying to get a timestamp using JDBC from an oracle database however i get the following error: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected %s got %s Now when i put the java.util.timestamp into the DB it appears to change. ...

Problems with ResultSet.relative()

385 byte By Night.Monkeya at 2007-11-27 9:00:42
When I try and use ResultSet.relative() and ResultSet.absolute() I get a runtime error stating Result set type is TYPE_FORWARD_ONLY. This doesn't make sense because I am calling ResultSet.setFetchDirection(ResultSet.FETCH_FORWARD) before using relative/absolute and I am using positive numbers ...

java.sql.SQLException: No suitable driver

431 byte By kmcnea at 2007-11-27 9:01:39
I know you've all seen this one before, but I cannot figure it out.I added the rt.jar to my libraries folder, my classpath and my WAS 5.1 servers classpath and java path and I still cannot connect. String url = "jdbc:odbc:ITV";Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection conn = ...

Application using JDBC - design advice

1231 byte By gvagenasa at 2007-11-27 9:03:02
Hi all,I am building an application that using JDBC, connects to an Informix database (using the Openlink JDBC drivers) in specific intervals, extracts some data, put them in a file and then send them using ftp.I am using Timer and TimerTask to implement the intervals. So every 30 minutes i ...

login page and -Xlint message on compilation

484 byte By bakesa at 2007-11-27 9:03:03
i have a login page which ought to call up another page once the password entered corresponds with the data on the table in the database.I tried to compile the code in the file Enter.java and i got the following message on the command prompt:NOTE: Enter.java uses or overrides a deprecated ...

How to make the previous buttons and next buttons?

3783 byte By bakesa at 2007-11-27 9:03:09
i have a table in the database. There is a page with three buttons Retrieve, Previous and Next as well as as text fields where the data retrieved does appear.Once i click on the retrieve button it retrieves a row of information onto the text fields. I want to be able to move to the previous or ...

how many Rows in a ResultSet ?

116 byte By khan_vu2007a at 2007-11-27 9:03:44
HI,How do i know that how many rows are there in a ResultSet?is there any method ?thanks

Large strings not getting persisted in table column annotated with @lob

3068 byte By Molsona at 2007-11-27 9:04:01
I am in a very terrible situation. I am trying to persist large strings into a table column with type CLOB. My database is in Oracle. I am using JPA and noticed that its fine with small strings, but crashes badly with the exception "streams type cannot be used in batching" ; if the strings are ...

Table Lock DB2

626 byte By dboyd68a at 2007-11-27 9:04:20
Hello All,Just wanted some advice, here is my situation.I have a message driven bean which i want to ensure i only receive once.So i am storing the MDB id's in a DB2 Database. (simple table that just stores MDB id's plus some other mdb data)I would like to do a table lock to keep MDB ...

Connection call

399 byte By tmmeta at 2007-11-27 9:04:45
Hi ,I am using datasource to get the jdbc oracle connection.I have a singleton class which has datasource as member variable and has two methods - getInstance () and getConnection().This singleton class's getConnection() will be called in all DAOs.Will I run into any performance or deadlock ...

Confusion with PreparedStatement

480 byte By rahulapva at 2007-11-27 9:05:14
I have a confusion regarding PreparedStatements. Can any body please clearfy it?As per java doc PreparedStatements are called precompiled staements. Why they are called so because as far I understand they exist in memory as long your program is running. They are stored in PreparedStatement ...

Connecting to Db with Oracle

312 byte By Subash_1983a at 2007-11-27 9:05:31
Respected sir/madam,I have written athe code to connect to the database using class.forName and i am getting either of the errors 1.exception in thread main noclassfounderror2.noclassfound oracle.jdbc.driver.oracledriver at runtime only i am able to compile it can you please help ...

how can upload doc file into database !!

4327 byte By senthil_yogaa at 2007-11-27 9:05:39
Dear Everyone,How can i upload a doc file into Mysql database ....can any one please give ur suggestions... i will show u my code upload.jsp**********<form name="uploader" action="uploaded.jsp" enctype="multipart/form-data"> <div align="center"> <table id="table1" border="1" ...

prepareStatement doesn't Like it when i use: LIKE %XYZ%'

730 byte By BamBam_a at 2007-11-27 9:05:48
Hey, I want to execute this:st = conn.prepareStatement("select msgid from log.msg_info where subject like ? ");st.setString(1, "'%" + (String)names.get(i) + "%' "); ResultSet rs = st.executeQuery();while (rs.next()){//for each mail with that timestamp......}rs.close();-The problem is that ...