View Sql string in PreparedStatement

3257 byte By northclouda at 2007-11-27 11:58:56
I am using PreparedStatement to update a table. In the debug phase, I want to see the sql statement string, does anyone know how I am able to see the sql string? That is, in below ***** area, what should I add to show the sql statement ? Thanks in advance.A sample code ...

Setting values

496 byte By River_Platea at 2007-11-27 11:58:44
Hello!My situation is this: I have a J form with buttons and text boxes as my GUI, and i have another class which makes the connection to the database. I'm doing CRUD operations with my GUI, but the only problem is with the select. I have a text box that accepts the employee ID, so when i press ...

How can I deal with an apostrophy

703 byte By CDCDevelopera at 2007-11-27 11:58:26
My simple questions is how can I deal with an apostrophy when I trying to save to the table, here is an example in how I am saving. 'Sandr'as Casa' this gives me an error message. I have to do it like thisStrings.replace("Sandr'as Casa"," ' "," ' ' "), a package functionSQLDesFollow = ...

How to Get SQL Results in Java?

755 byte By newjavagirla at 2007-11-27 11:58:20
Hello, I'm new to java and have a few questions when running sql. I have no problems connecting to the Oracle 9i database, but my questions are these:(1) I have a CREATE TABLE statement. How do I check to see if the table was actually created? SQL returns the statement "table created" if it was ...

HSQLdb server creation problem

2594 byte By Nibura at 2007-11-27 11:57:47
I have rattled my brain on this now for a few days. i have searched hi and low, and cant find an example on creating a server for the Data base HSQLdb, there is the code that i am using, the problem is it always returns as the discriptor "shutdown" and i dont know what i am doing wrong, thus NO ...

Batch updating timeout functionality.

525 byte By cbridlea at 2007-11-27 11:57:02
Hi,I have a problem where I have implmented batch updating in my application. However, we need to include a timeout feature that will execute a batch after a specified amount of time. For example, if we implement so that we add 25 statements to a batch before executing the batch, if there is a ...

How to read block of rows from database tables

487 byte By lmenariaa at 2007-11-27 11:55:48
I have created a Database Application in Java and display all the records in tabular format of one Table. This table have Millions of Rows, If I run Select * from Table, then my Machine not responding, so Now I wants to add paging of 1000 rows at one time.Is there are any option to read block of ...

problem with jdbc driver while running "myapplication".jar

540 byte By Epistimosa at 2007-11-27 11:55:12
Hi there guys,I have a problem running my java appplication from an exported .jar file. In fact, when i'm running my prog on bluej(Java IDE) it runs correctly with no probs or exceptions. But when it comes to export my application into a .jar file, i get the exception "No suitable driver found ...

problem with jdbc driver while running "myapplication".jar

529 byte By Epistimosa at 2007-11-27 11:55:10
Hi there guys,I have a problem running my java appplication from an exported .jar file. In fact, when i'm running my prog on bluej(Java IDE) it runs correctly with no probs or exceptions. But when it comes to export my application into a .jar file, i get the exception "No suitable driver found ...

compare 2 columns in a given table

359 byte By javaqueuea at 2007-11-27 11:54:25
Hi, Ihave to compare 2 columns in a given table Table_Test in oracle database . if the column1 > = column2 then "True" is displayed and if the column1< column2 then "False " is displayed. if i use the Decode() funtion then it just checks the Equality but not "<" or ">" . if you have any clue ...

SQL insert statement in java with Excel file

1685 byte By kzyoa at 2007-11-27 11:54:22
Dear all, I wrote a program is as the follow:import java.io.*;import java.sql.*;public class handleExcel {Connection con = null;Statement stmnt = null;public handleExcel() {String excel = ...

How to check the number of connections to MySQL DB

505 byte By Sandeep009a at 2007-11-27 11:53:13
Hi,Is there some way to check the number of applications connected to a mysql database?I have two different Java applications that will be using the same instance of MySQL.My requirement is that, I want to close the MySQL instance while closing the Java application.But before doing so, I want to ...

oracle driver problem

2512 byte By sahaanaaa at 2007-11-27 11:53:02
i have created a webapplication using java, struts and hibernate3.0my database is oracle9ii have netbeans 4.1 as IDEiam using sunjava webapplication server for my deployment purposes.My webapplication was working fine until recently when i restarted my system where the applicationserver was ...

user must supply a JDBC connection

26460 byte By sahaanaaa at 2007-11-27 11:52:58
i have created a webapplication using java, struts and hibernate3.0my database is oracle9ii have netbeans 4.1 as IDEiam using sunjava webapplication server for my deployment purposes.My webapplication was working fine until recently when i restarted my system where the applicationserver was ...

Lock on GetConnection

1127 byte By SmartBart1701ea at 2007-11-27 11:52:19
Hi all,i've a thread that open a jdbc thin connection on oracle db in every instance of it.for explain something like this:public void run(){........ Connection conn=null; try{ ....................< log lines 1>conn=DriverManager .getConnection();conn.setAutocommit(false);................< ...

Thread Saftey of JDBC Connection and PreparedStatements

358 byte By winderjja at 2007-11-27 11:51:31
Can I share Connection and Statement (PreparedStatement) objects between threads?I have some concurrent processing that is inserting records using the same SQL syntax and I would like to create a PreparedStatement to improve the performance. The statement needs to be accessed by multiple threads to ...

BLOB-Instance?

330 byte By Oleka at 2007-11-27 11:50:41
Hi, I want to create an instance of a BLOB(MySQL-DB). I use the MySQL-jdbc-driver. The problem is, that the constructor of the BLOB-class is not public. And i don't see any Factory-methods for creating a BLOB-object. The reason is - i want to store pictures in a DB. But i don't want to use ...

oci vrs thin

47 byte By AlberAlbanDeVrila at 2007-11-27 11:50:32
<p>what is better OCI or thin?</p><p>thanks</p>

Returning large resultset problems

599 byte By dhaval_shaha at 2007-11-27 11:50:25
I've got a problem returning a large resultset (approx 1.2-1.5 million rows), in that sometimes the query doesn't run to completion because either I'm pretty sure the client keels over, dies, you get the picture. I've usedstmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, ...

viewing records via Jbuttons and resultset

3391 byte By raven147a at 2007-11-27 11:50:09
i am trying to view records from a database upon clicking the NEXT buttun in order to bring in the next record. Before that i click SHOW ALL which brings me all the records. However, it only shows me the first and last. I did a system.out.println and it shows me all the records inside the ...

struts & database sitedat

73 byte By suse69a at 2007-11-27 11:49:52
<p>Can anybody tell me a good site or link on struts & database ?</p>

Convert a Number to time in Oracle

308 byte By javaqueuea at 2007-11-27 11:48:22
Hi, In a oracle database table i have a colum that gives the value from 0 to 2359. I want to convert Number to time in Oracle. Any i dea on the query for this. I have tried SELECT TO_CHAR('2342','HH:MI') "Time" FROM dual; but it is not ...

PL/SQL Procedure and Java

2047 byte By Vikas.Vija at 2007-11-27 11:47:12
Hi All,I am working on a Data Warehousing Product and generating Web Reports.These Web Reports are JSPs.The basic architechture used for this is :1. Get the inputs required for Report Generation through a Web GUI2. Validate and Process (If Valid) the inputs so that it can be applied on the Data in ...

Handle Exceptions of database importing from dump

247 byte By yaronra at 2007-11-27 11:47:00
<p>I'm restoring my MySQL database from java code.</p><p>I use Process for running a batch file and i need to roleback if there were any exceptions.</p><p>How can I track the exceptions?</p><p>Is there any way doing it with jdbc "Statements"?</p>

insert and retrieve huge amount of data

363 byte By suryakula at 2007-11-27 11:45:30
hi,i am developing a website .i would like to know if it is safe to use servlet+jdbc to insert large data like blob/clob in MYSQL 5.0.i also anticipate large nuber of transactions like dtaa retrival and data storing by users.Is it fin efor me to use MY sql 5.0 and servlets to do this process.please ...

invalid cursor state

433 byte By Daiesha at 2007-11-27 11:45:01
Hai AllsrcSmt=srcCon.prepareStatement("select * from main_info, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);srcRst=srcSmt.executeQuery();There is no records in the table "main_info", but the srcRst.next() method return true? . and it shows "invalid cursor state error" .Why i got ...

How to stop a very long procedure

873 byte By viddaka at 2007-11-27 11:41:49
Hello everybody,I have a question about a problem that I have.I have a sql procedure that is running. This procedure is very long, sometime one hour.But in some case, we must stop it in order to run another procedure more important.For this emergency, I do two threads : main thread that launch ...

Problems with PreparedStatement

1957 byte By River_Platea at 2007-11-27 11:41:45
Hello all!I'm having problems with the PreparedStatement in my class.. This method is going to insert data into the DB with parameters passed from another class. This is the error that Netbeans provides when i compile :-symbol : method PreparedStatement(java.lang.String)location: interface ...

Unable to connect to Ensembl MySql Database

646 byte By dhaval_shaha at 2007-11-27 11:41:40
I'm trying to connect to the snp_mart_45 database in Ensembl (port number 3316) with the following config:final String ENSEMBL_CONNNECTION = "jdbc:mysql://martdb.ensembl.org/snp_mart_45:3316?user=anonymous";However, I get a socket exceptionMESSAGE: java.net.ConnectException: Connection refused: ...

Failing to manage mix of jdbc and hibernate transaction under Spring

1830 byte By dee_vama at 2007-11-27 11:41:07
Hi My application has some dynamic tables where we are generating table names and the columns based upon client requirements,for this dynamic tables we are using jdbc and the rest is hibernate .here i am unable to propagate the same transation from hibernate to jdbc.When something fails in middle i ...

multiple resultset

290 byte By mpelasa at 2007-11-27 11:41:06
<p>Hi,</p><p>I'm trying to execute a specific query by clicking a button.I was trying to use inside actionperformed code different Statement and resultSets but every time throws errors.I'll be appreciated if someone give me an example similar to the previous description.</p><p>Thanks</p>

Upadate all queries in executeBatch

522 byte By prasadmcaa at 2007-11-27 11:40:07
Hi,I am trying to insert bulk records into table using addBatch & executeBatch. while inserting through executeBatch if any one of records throws exception remaing records are not updated (for example if i am inserting 10 records if 5th record fails to insert into table i want remaining 6 to 10 ...

javadb and ireport

846 byte By greenockboya at 2007-11-27 11:39:31
HiI am trying to set up a connection to the javadb database. I have created the database via the netbeans IDE and have a simple table. The table is located in C:\javadb\database.My iReport connection settings are:JDBC Driver - org.apache.derby.jdbc.EmbeddedDriverJDBC URL - ...

getting error while connecting to database

1065 byte By brittle_bonda at 2007-11-27 11:39:00
while i try to connect to the database i'm getting the foollowing errorjava.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)the part of my code which is used to connect to the database is as follows/* <applet code="Part1" width=500 ...

update in mysql console does not show in application

509 byte By jposthuma at 2007-11-27 11:38:59
Hi,I have a question. I made a complete J2EE application on top of a mysql database. When I delete or insert or update a table in my application the changes show instantly. In my application I use PreparedStatement.The problem is when I want to edit some data in the database using the mysql command ...

which folder to put the .war file in oc4j

175 byte By QussayNajjara at 2007-11-27 11:38:17
<p>hi to all..</p><p>i'm new to oc4j .. i used to work on tomcat.. and i know that i used to put the war file inside /webapp folder .. now in oc4j where shall i put it...</p>

Convert SQL data and xml into one XML datasource

728 byte By nitin403a at 2007-11-27 11:38:13
Hi!I trying to code for Report using jasperReport.I need to pass two different data source to the jasper report.But jasperReport support only one datasource.Both the datasource will be decided in runtime.One of my datasource is SQL and other is XML these datasource has different Numbers of Row.(I ...

error message: datasource is null

7037 byte By jin412a at 2007-11-27 11:36:31
my code:<%@ taglib prefix="c" uri=" http://java.sun.com/jstl/core_rt" %><%@ taglib prefix="sql" uri=" http://java.sun.com/jstl/sql_rt" %><%@ page import="javax.sql.DataSource" %><sql:setDataSource var="jdbc/myoracle2" driver="oracle.jdbc.OracleDriver" ...

MySQL Hibernate Problem

440 byte By mon.goosea at 2007-11-27 11:36:02
When entering a date into a MySQL database through hibernate, the date is eventually changed to be one day before the one originally entered. I can't think of anything that might be doing this, could someone offer a suggestion as to a solution? I find this problem very odd, and don't know where ...

DB2: result set is closed

1288 byte By isc049a at 2007-11-27 11:34:42
Hi,I have a DB2 db as source and an Informix DB as target db. I have something like this:String sourceSql = "SELECT x FROM y";ResultSet rs = ...;Connection targetConn = ...;PreparedStatement ps = null;while(rs.next()) { Long x = rs.getLong("x"); String targetSql = "INSERT INTO y (x) VALUES (?)"; ps ...

can't know why SQLException

1131 byte By QussayNajjara at 2007-11-27 11:34:33
Hi ...in one of my methods there's this query executing...the query is executed perfectly, but whenever i want to check if the result set coming from it, if it's null or not, i get SQLException,, i have the same problem in another method...here's a snap of the method..ResultSet resultSet2 = ...

How to manipulate a CachedRowSet?

449 byte By lezhanga at 2007-11-27 11:34:18
Hello to all:I've encountered a tough problem with CachedRowSet. I need to construct a dynamic CacheRowSet reusable later without updating his data Source: I've tried moveToInsertRow(); and insertRow to add a new line but it seems to me that my new rowset can not be read when I do "rs.next()" who ...

how to insert a string containing a single quote to the msql database? help

139 byte By sijo_jamesa at 2007-11-27 11:33:16
<p>how can i insert a string which contains a single quote in to database... anyone help</p><p>Message was edited by: </p><p>sijo_james</p>

doubt in connection pooling

226 byte By 83Krisha at 2007-11-27 11:33:03
<p>hi frnds, i have created my own connection pooling class,i need to implement this class in my struts application i dont where to initialise my connection pooling class.... can anyone tel me the suggestion to do that...?</p>

Problem with populating ROWSET

509 byte By Java_persona at 2007-11-27 11:32:12
Hi ,I have a problem with ROWSET.I have a table with 6 columns and approximately more than 200 records.I reterive them in a ResultSet and resultset gets populated.But I populate Rowset with that ResultSet then it hangs for atleast 1 minuate and then it comes back to its original state.Can anyone ...

using JCheckBox, JButton and JTextArea with JDBC

946 byte By james-mcfaddena at 2007-11-27 11:32:04
Hello shlumph and SoulTech2012.thanks for the reply. Im wondering do any of you have links to web pages that include tutorials and source code on using JCheckBox, JButton and JTextArea with JDBC. would any of you who have experience with using JCheckBox, JButton, JTextArea and JDBC together be able ...

performance problem with recordset object

635 byte By urssireesha at 2007-11-27 11:30:40
Hi,I have a performance problem with record set object. Is it true using RecordSet object as argument to the method will cause any perfomance degradation?here is my code.finStmtList = selectFinancialStatements(rs, shortFormat, latestOnly, true);I changed the code by populating the recordset in the ...

Driver support for SQL-Server from Linux machine.

401 byte By Subbu_javaa at 2007-11-27 11:30:33
Guys,we have developed a java application with SQL-Server as backend, under Windows platform.now, we are converting that to Linux platform.In Linux, i am getting problem with using the same driver for database connectivity, which i used under Windows.do we need the linux version of that same ...

Hibernate binding problem

578 byte By lemaa at 2007-11-27 11:29:42
hi folk.i'm considering some examples of jboss, "jbossatwork" http://www.jbossatwork.com/downloads.html. i somehow understand first 4, but i'm now stuck in 5th.as i get, the problem is in binding hibernate. see, in 4th example (ch04) it binds through JDBC (JDBCCarDAO), and in 5th (ch05/05a-list) ...

why this Query is not running

968 byte By smallkida at 2007-11-27 11:24:59
select col1,col2,col3,col4,col5 from TABLEwhere col1 between 816 and 18644 and col2 between 0.19 and 8.02 and col3 between 'D' and 'Q' and col4='FL' or col4='VVS1' or col4='VVS2' or col4='VS1' or col4='VS2' or col4='SI1' or col4='SI2' or col4='SI3' or col4='I1' or col4='I2' ...