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 ...
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 ...
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 ...
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 ...
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 ...
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.. ...
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, ...
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 ...
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
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 ...
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 ...
Hi,allI want to study Hiberante.So which book is best for understanding Hibernate ?Or online Soure to start from scratch.Thanks
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
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
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 ...
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.
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 ...
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
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 ...
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 ...
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
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 ...
Dear Sir,What is the use of shift Operator("<<",">>","<<<"),which API is using shift operator?please help me clear this question.
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 * ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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..
Hello,Can anyone give me the code to connect to My SQL from JavaScript. I am using Javascript in ASP.Thanks,Vijay
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 ...
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 ...
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.
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 ...
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. ...
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 ...
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 = ...
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 ...
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 ...
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 ...
HI,How do i know that how many rows are there in a ResultSet?is there any method ?thanks
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 ...
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 ...
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 ...
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 ...
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 ...
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" ...
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 ...