How to move record from one table to another one within same DB

454 byte By kikibosa at 2007-11-27 10:17:16
Hi, AllWhat I'm trying to do here is move a specific record in table A to a history table called A_HIS. The only differece between these two tables are A_HIS has two extra fields that record the insertion time and user. All the rest of fields are the same.Since table A has more than 40 fields and ...

Resultset problem

846 byte By karenJJa at 2007-11-27 10:17:19
Hi all,I encountered a problem executing the following code:/********************************************************************/ResultSet rset = sql_stmt.executeQuery("select NAME from test");rset.last();int size=rset.getRow();rset.first();int fileInd=0;while (rset.next()){ fileName[fileInd] = ...

on what basis did we choose the driverID to be equal to 22

457 byte By myriam.neaa at 2007-11-27 10:17:37
i am using a microsoft access driver in my jdbc connectionhow did we choose "22"for the driverID below is the string path of the databaseString url = accessDBURLPrefix + filename + accessDBURLSuffix;String accessDBURLPrefix="jdbc:odbc:Driver={MicrosoftAccessDriver(*.mdb)};DBQ="; String ...

Stored procedure hangs -- thread locked.

7079 byte By Nosf3ratua at 2007-11-27 10:17:45
How can I determine what is locking my object?I ran a kill -3 on my Tomcat process which produced this, but I don't understand it:at java.net.SocketInputStream.socketRead0(Native Method)at java.net.SocketInputStream.read(SocketInputStream.java:129)at oracle.net.ns.Packet.receive(Unknown Source)at ...

MySQL BLOB-instance

151 byte By Oleka at 2007-11-27 10:18:03
<p>Hi,</p><p>How can i create an instance of BLOB in MySQL?</p><p>The constructor of the corresponding class is not public.</p><p>Thanks for replys</p>

ResultSet.next() throws NullPointerException

6290 byte By Java.Newbiea at 2007-11-27 10:19:11
Hello,When running the following code:import java.sql.*;class DatabaseDriver {private intdatabaseType;private Stringerror;private Connectioncon;private Statementstatement;private ResultSetrs;static final intMYSQL_DB_TYPE = 1;static final intPGSQL_DB_TYPE = 2;static final intMSSQL_DB_TYPE = 3;static ...

Apache DBCP not creating min connection

1585 byte By Ananth.duraia at 2007-11-27 10:20:01
Hi,I configured my app with Apache DBCP.. But when i checked initially it fail to create minimum connection.. am i miss anything here... here is my configuration file.<ResourceParams ...

Call Procedures...

206 byte By Shebua at 2007-11-27 10:20:24
<p>hi..</p><p>Can anyone tell me how to create call procedures in java, particularly the one that can take parameters and how to pass parameters in them... complete things using java programming only...</p>

applet: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

2522 byte By Smirnov.Alexeya at 2007-11-27 10:21:42
I use lib mysql-connector-java-5.1.0-bin.jar in my applet. My applet signed.In appletviewer all Ok. But in browser I have the next exeptions:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureLast packet sent to the server was 0 ms ago.at ...

MVC & ResultSet...

288 byte By jini4javaa at 2007-11-27 10:21:49
<p>Hi...</p><p>Why one should use a Collection object which contains javabean objects (one for each for each database row) over ResultSet object in MVC? What are the advantage on not using ResultSet in MVC at presentation layer?</p><p>I hope my question is clear enough.</p><p>Cheers.</p>

make adatabase connection by reading from a properties file

362 byte By Priyoa at 2007-11-27 10:21:58
i have following five instancesx,y,z,a,cfor x it has the processes wp,we,dgy it has the processes wp,we,waz it has the processes wp,dg,waa it has the processes wp,dg,wac it has the processes wp,dg,waconnection is to be made by reading from a properties file containing the instances & ...

Storing max(id).

217 byte By Antoniosa at 2007-11-27 10:22:01
<p>I am want to find the max(id) from a table named customers and column Id. I am using this SQL command "SELECT max(Id) AS maxid FROM Customers". Now how do I store the maxid into a variable so that I can use it?</p>

Derby shutdown in embedded server

796 byte By supertorpea at 2007-11-27 10:22:23
I want to start a derby embeded server in my application (see http://db.apache.org/derby/manuals/admin/hubprnt09.html#HDREMBEDDEDSERVEREX), in such a way that the application could access to the database in embedded way to get the maximum performance and, simultaneously, I can connect to the DB ...

Changing database entry only by entering a password

460 byte By 3xad3u5a at 2007-11-27 10:24:28
I'm trying to have a page that displays a persons data and each person is assigned to an agent. I want the field where the persons agent can be changed to have a password.i.e if some other agent tries to change the persons agent they have to fill in the original agents password, so that only the ...

ResultSet/Statement close()

455 byte By causea at 2007-11-27 10:24:31
Has anybody had any problems with using close() method for Statement and ResultSet objects? I've got a simple piece of code that creates connection (SQL Server 2000), statement, runs simple query (select * from table_name). It returns me results, but when I try to close my ResultSet object and/or ...

Derby connection :(

989 byte By jawadaha at 2007-11-27 10:25:21
HiI'm new to Derby and never heard of it before. There are few questions i want to ask. Can i use this database for medium type of organization. I am using Netbeans for application development. So my derby position is on C:\and my database is on the F:\. ... When i use Embdedded driverhow can use ...

invalid arguments in data source

4509 byte By jin412a at 2007-11-27 10:27:00
I try to do search function using JSP. no compile error message but when I click sumit on the page. I have the following error message.can you help me? it probably caused by datasource connection or custome library path?HTTP Status 500 -type Exception reportmessagedescription The server encountered ...

mysql connection in eclipse?

426 byte By yubak123a at 2007-11-27 10:29:43
Hello, I had successfully connected mysql database in NetBeans and i am currently doing my project right. But i also need to connect the same database from eclipse too, but i am not able to connect from eclipse. Is there any jar file i need to put somewhere?Can anyone help me out, i think the code ...

call java from sybase trigger

230 byte By michal.stachurskia at 2007-11-27 10:29:48
<p>Is it possible to call java from Sybase trigger ? If so can you please supply example or URL to one ? Alternative solution is to call shell script from sybase trigger (as app is based on Solaris).</p><p>Regards</p><p>Michal</p>

Statement Object

348 byte By SwapnaliDashratha at 2007-11-27 10:30:29
Hello Friends !I am using same statement object for executing various queries in to the program.should i use same statement object for various queries or should i use different Statement object for that.we are using JDBC 2.0 and connection through system DSN. Is it sufficient forconcurrent database ...

Connection in form

2047 byte By River_Platea at 2007-11-27 10:31:35
Hello All!I want to do an insert into my database using Stored procedures. I already know how to delete and select.. i'm gonna post part of my code in wich i make a select to give u gives an idea of how im doing the statements.. if there's anything wrong please let me know.private void ...

JDBC and SQLServer2000 - parsing a comma-separated string to search on int

1115 byte By lokhandeusa at 2007-11-27 10:32:28
I am using sqlserver2000 and JDBC on Windows XP platform.From a webpage i get a user input string in the form "'1', '2', '3'". This string may contain only one value for ex. " '1' ".Database column is of type int.I build the query string based on user input and then use prepareStatement ...

Connect to excel sheet w/o saving it to server

442 byte By geiz777a at 2007-11-27 10:33:53
I an excel file submitted to a jsp page that connect to the excel file and read from it like a database.Right now I have to save the excel file to a physical location then connect to it ie:DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver ...

Type Mismatch: Cannot convert from Connection to Connection

1958 byte By hemanthjavaa at 2007-11-27 10:34:24
import java.sql.DriverManager;public class Connection {public static Connection getDatabaseConnection(){Connection con = null;try{// load the driverDriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());// get the connectioncon = DriverManager.getConnection ...

automatic column creation and hence query customization

957 byte By Sarvanandaa at 2007-11-27 10:34:39
I am in the process of creating a jsp which can be configurable ( as in you can add fields using an admin ) .Lets say, the details of this page relate to table abc (which has col1, col2, col3) as of now.Now, since the page is configurable ultimately I also need to be able to make the table to be ...

Editing Table Doesnt Wanna Work! :(

1140 byte By Alex1989a at 2007-11-27 10:35:21
this is my method that is used to edit contacts in my CONTACTS table: public void editContact(ContactPanel updatePanel){try{preparedStatement = connection.prepareStatement("update CONTACTS set NAME = ?, NUMBER = ?, EMAIL = ? where ID = ?");preparedStatement.setString(1, ...

Can't connect

331 byte By Purujita at 2007-11-27 10:35:57
hi,I have just started with JDBC(newbie).I have MS SQL server 2000 which I tried to connect using JDBC, but I always get ClassNotFoundException.I m using type 4 driver which I downloaded from MS web site.I have even added the jar files in the classpath but still no use.Please ...

A Common Problem with Connectivity

2434 byte By ArikArikArika at 2007-11-27 10:36:09
I have a computer which im treating as a database server (yes, a very weak one...) My problem is that I cannot access the server database from my computer. I've seen this problem ALOT and i've tried all of their answers and they dont seem to be working for me.My goodies:import java.sql.*;public ...

Simple Example, I Need Help!

8560 byte By shlumpha at 2007-11-27 10:36:13
I'm working on a very simple application using Eclipse and MySQL here it is: http://img.photobucket.com/albums/v335/shlumph/table.jpgIt's pretty self-explanitory. You enter a person's first and last name, press submit, and their name flops onto the table. I made this naively, and do not know how ...

Configuring Oracle with java

348 byte By skanugantia at 2007-11-27 10:36:18
hi,I want to explore jdbc and so want to configure oracle with java.can you please let me know what driver i need to use( i want to go with type4) for oracle 9i. can i get a link to download this driver?also where i need to put this driver(which folder) and what path variables i need to ...

Trouble with access database online

981 byte By synergy_guya at 2007-11-27 10:36:24
Hello everyone,I created an applet that simply inserts data into an access database and then prints it out on the screen the sql insert statement.I signed the applet so I can trust it so I wont get any security errors. When I upload it to the site it shows the correct insert statement because the ...

Merging 2 databases - MySQL

163 byte By yaronra at 2007-11-27 10:37:29
<p>I have 2 databases on the same datastore.</p><p>Both of them have the same structure, but different data.</p><p>Is there any easy way to merge between them?</p>

Connecting to a sql server database using netbeans 5.5

257 byte By minasamya at 2007-11-27 10:38:17
<p>hi all</p><p>if you please could any body tell me detailed steps for establishing a connection to a sql server database using netbeans 5.5</p><p>i need to know what driver to use and the format of the url i use in making a new connection</p><p>thanks</p>

can someone be kind enough ...

5750 byte By schumachera at 2007-11-27 10:39:45
hello. i am trying to run a simple jdbc program. I have mysql4.1 installed. i have installed the mysql J connector also. i've set the classpath for the .jar file under eclipse also for the connector. i have created a username and password and have loaded the script also in mysql. but when i try to ...

Can someone show me how to connect to an MS Access database

253 byte By leolee1022a at 2007-11-27 10:40:26
<p>I am new to the database connection</p><p>I don't know what should I do</p><p>I am now having the MS Access & JRE</p><p>What should I do next?</p><p>Can someone show me the most simple and typical code about connecting to an Access database?</p>

Not able to fetch updated data using jdbc and oracle 10g

441 byte By DEVESHGOTEa at 2007-11-27 10:41:10
Whenever i m updating the data and fetching the same record after updating i m not able to get the fresh/new updated data , old record is fetched every time, but when i checked in database the record gets updated successfully , even if i fire the query two times after 10 seconds using Thread.sleep ...

Man this forum is really screwed up since the festivities of last week....

383 byte By cotton.ma at 2007-11-27 10:41:27
There are threads that only appear in the "category" view and not in the "forum" view and vice-versa. And they seem to jump in between the two views. Compare category view http://forum.java.sun.com/category.jspa?categoryID=34to the forum view http://forum.java.sun.com/forum.jspa?forumID=48These ...

Can any on Explain

676 byte By Husama at 2007-11-27 10:42:31
import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import oracle.jdbc.pool.OracleDataSource;public class ConnectionThread extends Thread {private OracleDataSource_dataSource;private int_cycles;public ConnectionThread(OracleDataSource dataSource, int cycles) ...

JNDI issue - from Tomcat tutorial

5043 byte By Meepa at 2007-11-27 10:43:04
[nobr]I changed names in the tutorial to get a string from mySQL db to the jsppage. It returned no errors, just a default string - "Foo Not workin" I looked up the tutorial, and the topics regarding this, it looks like it is jars, and naming errors. I already put the jars in the common/lib ...

problems with insert into and char "

2057 byte By Asaaka at 2007-11-27 10:44:04
Hi all!I amb doing a program wich interacts with a .mdb database. All works fine but excepts for one thing:More or less like this is my database table:table liniaAlbara{PK idLinia ( auto)idAlbara workerworkstationworkDonehoursdate}if I do the next query with microsoft access all works fine :insert ...

struts connecting database

2691 byte By suse69a at 2007-11-27 10:44:06
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 ,The problem is: The ...

Connection pooling..

599 byte By Pathuma at 2007-11-27 10:47:22
Hi I'm using an oracle database for my multi threaded Java application. I need to have a multiple database connections for several threads in that application.Is it ok to use Connection pooling for this purpose ?Currently Im facing some performance issue in using single connection.I need to ...

Problem with INACTIVE connection

353 byte By Ananth.duraia at 2007-11-27 10:47:49
Hi, In my application i did connection pooling using Apache DBCP. but while monitoring connection the INACTIVE Connection seems to grow gradually. But i am sure i close all the connection properly and this kind of problem is not araising with out connection pooling. Please Suggest me what should i ...

SQL update from an array

1504 byte By haggard17a at 2007-11-27 10:48:16
Hi guys,Ok i have an array which collects 'quantity' values from the previous jsp and the aim is to update my DB with these values. The updating of the specific records is working fine (in the sense that it finds the right recorded to update.However the problem is that it updates all the records ...

Error to Read Excel for Unix

1161 byte By lele63a at 2007-11-27 10:48:36
Hi,I develop one class for read the sheet Excel and write one table Oracle.The Class go perfectly i in Windows XP but in Unix go error :Exception in thread "main" java.lang.NullPointerExceptionat sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)at ...

Stored procedure in Postgres

327 byte By jeet_Punea at 2007-11-27 10:48:47
Hello guysi have a problems of writing the stored procedure in postgresSQL 7.2? is anybody reply me how can we write a procedure which will fetch all the record from a table likesuppose i have a employee table which has two file empname and empid.select *from emp where ...

ResultSet size

257 byte By jini4javaa at 2007-11-27 10:49:43
<p>Hi all,</p><p>Is there any simple way to get the number of rows in a ResultSet object before iterating it? Right now I have to iterate it the ResultSet object first and then I can determine the rows....</p><p>Is there any faster method?</p><p>Thanks.</p>

Multiple executeUpdates() issue

1559 byte By vikenga at 2007-11-27 10:49:50
Hi Friendsi am having a problem for which i need your suggestion.i have a code as belowconn = ConnectionFactory.getInstance().getConnection();stmt = conn.createStatement();stmt.executeUpdate("INSERT INTO Client ( clientPk, provincePk, countryPk, statusPk, branchPk, salutation, weight, ...

Too Many Connections!

2204 byte By mon.goosea at 2007-11-27 10:49:56
Hi,I have a JSF application that is using hibernate to persist data to a MySQL database, but after doing a few small operations in the application I get the error:com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: ...

large number of rows in ResultSet

226 byte By Daiesha at 2007-11-27 10:50:45
<p>Hai,</p><p>I have huge number of rows retrive from database using ResultSet but it seems to be slow to get records. When it retrive data from database can we read data from ResultSet?.</p><p>Advance wishes,</p><p>Daiesh</p>