Invalid Handle!

902 byte By ac_santos at 2007-9-26 8:31:21
Hi all,when I run my program it returns always the following exception:java.sql.SQLException: Invalid handleat sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)at ...

How to set AUTOCOMMIT=false in with CMT an

821 byte By yaksenov at 2007-9-26 8:31:28
Hi all!A'm using EJB's with transaction attribute=Container. This is simple scenario:-call Session Beanbegin transactioncall EntityBean1 { database update 1}call EntityBean2 {database update 2}end transactionreturn from session bean-The problem is:when update2 fails update1 not rolling ...

Handling null column values

208 byte By phil_haigh at 2007-9-26 8:31:30
I can't find any samples that show how to handle null values returned in a JDBC Select statement. My code bombs out on setLong etc if the column is null.Any suggestions much appreciated.

How set autocommit=false with container transactions?

821 byte By yaksenov at 2007-9-26 8:31:31
Hi all!A'm using EJB's with transaction attribute=Container. This is simple scenario:-call Session Beanbegin transactioncall EntityBean1 { database update 1}call EntityBean2 {database update 2}end transactionreturn from session bean-The problem is:when update2 fails update1 not rolling ...

Problem in updating a Integer column in table

392 byte By smitaunni at 2007-9-26 8:31:39
I am using Jrun and MS SQL..I have a problem in updating the value of a column in a table.If I say..rs.updateInt(1,1)rs.updateRow()Instead of updating it to 1...it updates it to some value like140299556 etc...If I carry out the updation again...the next time it updates it to 0..Any idea why ...

Checking 'where x is null' using PreparedStatement

457 byte By wolfS at 2007-9-26 8:31:48
Using the prepared statement:select * from table where x = ? and y = ?;In Oracle if I explicitly want rows where x is null in the table, this does not work because if my substitution value is null the substitution fails. If I use setNull() on the substitution value then the execute fails. Am I ...

Cant update a row Oracle 8i

1247 byte By antonjenkins at 2007-9-26 8:32:00
HiHave I missed something really obvious, but I can't seem to update a row using a resultset on an Oracle 8i table. It blows an exception about the result set being read only when it isn't.Sample code:DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn = ...

JDBC - Day of the week

245 byte By niallmc76 at 2007-9-26 8:32:28
I am retrieving a date field from an access DB using odbc:jdbc. I need to knwo how I can get the actual day of the week (mon, tues etc.), or even the numbers 1-7 from this. Thank you,Niall McCarthyniallmc76@eircom.net

java.sql.Date and Oracle

697 byte By aldus99 at 2007-9-26 8:33:16
I need to able to insert date & time values in a DATE column of an Oracle table.The following codejava.util.Date utilDate = new java.util.Date();java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());PreparedStatement stmt;stmt.setDate(1, sqlDate); sets the date in the column alright ...

MM MySQL Driver with JDBC Problem

1479 byte By JavaZach at 2007-9-26 8:34:24
I am trying to get it so that I can use JSP and servlets to connect to a mysql database on my server. It is a new dedicated machine, so I am a bit new to the whole admin thing, but I do have Perl and ASP (Chillisoft) all connecting to the DB that I am trying to use JSP with, without any ...

Exausted ResultSet?

258 byte By sachindlwc at 2007-9-26 8:34:46
In my Application Sometimes i get SqlException : Exausted Resultset . It doesnt specify more than that and it does not happen always so I cant understand whats wrong . If anybody came across this could you please help.ThanksSachin

problem with acceptChanges() in CachedRowSet

815 byte By kala76 at 2007-9-26 8:35:02
HI ,When I execute the following piece of code , I get the following exceptionSQLException: Closed ConnectionClass.forName("oracle.jdbc.driver.OracleDriver");Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@","scott","tiger");crs = new ...

Query from MS-ACCESS:

382 byte By khiz_eng at 2007-9-26 8:35:16
Hi to all,Can anybody assisst me in providing solution, as everyone knows well that SQL statements can be executed and it views in well define GUI form , i mean tables with rows and column, in the similar way my application should executed for every 100 records inserted and display in similar ...

setDouble

286 byte By mattias_westerberg at 2007-9-26 8:35:58
Hello!I am trying to insert a Double valu into my database.st.setDouble(2, Double.parseDouble(cost));For example. I know taht the string cost is "100.50".But what actualy ends up in the db is 100.0.Why is the decimals disapearing?

page load problem

507 byte By pkshnarnond at 2007-9-26 8:36:19
hi allours is going to be a e-trading website, which includes a lot of huge sized JSP(up to 80 kb),html,script files and access to session beans with not much gifs and jpeg files.but the problem at the helm is, most of the pages of our site takes 30-50 seconds to load.and to the utmost surprise ...

JSQLConnect driver giving error while executing CallableStatement.

3892 byte By shivanet at 2007-9-26 8:36:51
hello JavaExpertsplease help me in following case.we are working on a jsp based application, our application server is TOMcat.database server is SQLSErver7.0.we are using SQLConnect driver jdbc connectivity.that driver is working well for most of stored procedure.but it not working for ...

why is this happening URGENT

573 byte By naslund26 at 2007-9-26 8:37:09
Im attempting to query info. Using MS SQL 7.0. Using statement SELECT * FROM Table1 WHERE Invoice = '" + string + "'" . This is to return a row with about 32 columns. I can read the read info from the first column and then I have no idea what happens.. I have a swith statement which ...

Update a date field in SQL database

423 byte By smitaunni at 2007-9-26 8:37:13
I am using MS SQL 2000..and .Jdbc-odbc bridgeI have a field of type datetime...I am trying to update that field value...using the following coders.updateDate(fieldname,java.sql.Date.valueOf(fval));rs.updateRow();where fVal is a string...It gives me a SQl Exception saying invalid date value..Can ...

[ODBC dBase Driver] insert and update errors.

652 byte By justask666 at 2007-9-26 8:37:16
Hello,I am using ODBC dBase Driver to work with *.dbf files with sun's JdbcOdbcDriver.CREATE TABLE and INSERT statements work fine. Files are not read only for sure.While trying to delete i get[ODBC dBase Driver] Could not delete from specified tables.error.While trying to update i get[ODBC ...

How to test whether a table exists in database?

238 byte By tanqiang at 2007-9-26 8:37:19
How can I test whether a table exists in a database before I execute a query? If the table doesn't exist, I want first create a default table with certain name so that I can always display something in JTable.Thanks!

Container-Managed transactions using JDBC, Orion and MySql

2282 byte By dleemans at 2007-9-26 8:37:47
Dear All,My problem is the following.I am running an application under Orion Server with a MySql database behind.I would like to implement safe transactions using Container-Managed transactions.Therefore, I intend to use JDBC.My concern is that everytime I see examples doing that, they use ...

How to get values from resultset when using subquery?

1193 byte By hema_neni at 2007-9-26 8:38:15
Hi , I have a problem in executing sql query from java.I am executing an sql query which return a intersection of values from 3 tables. Here is the query I am usingselect id from dps_user where id in (select b.id from dps_user b,laserlink cwhere c.userid='univ.'||b.login and c.status ...

jdbc system query

960 byte By marcalena at 2007-9-26 8:38:37
Hi,Can anyone tell me what actually i should do for my system.My initial plan is to create an application and use it to connect to Windows SQL Server 2000.My questions are:1)What type of driver i must use?Defintely type 4 driver?2)What should i do in order for the application to connect to DB ...

Retrieving The Size of A ResultSet

409 byte By carrich1 at 2007-9-26 8:39:33
Hello,I need to know the size of a ResultSet (rset) before I ever implement the "next" method (rset.next()). I have been encountering numerous errors with rset.getFetchSize() especially if I implement it outside of my fetch loop ( while (rset.next()) ). All I want to know is how many rows are ...

Connecting MySql

93 byte By shamik1 at 2007-9-26 8:40:06
Can anybody tell me how to connect to MySql with a sample code?Thanks in adv...

socket write error -- jdbc connection problems?

1505 byte By suePB at 2007-9-26 8:40:19
Hi,Newbie question: Could repeated 'java.net.SocketException: Connection reset by peer: socket write error' errors eventually cause problems with jdbc connections? This could be completely unrelated, but searches submitted to a access database via an openlink driver that had been working ...

identity of rowws

99 byte By cuts at 2007-9-26 8:41:38
anyone know a good way to return the identity of a row that was just inserted?

reading blob results in strange SQLException

2432 byte By koem at 2007-9-26 8:42:29
Hi,reading a previously stored zip-File (as Blob) results in this Exception (I am using DB2 on Windows connecting by ODBC):java.sql.SQLException: Error allocating memory for dataat COM.ibm.db2.jdbc.app.DB2RowObject.SQLBindColumns(Native Method)at ...

dynamic creation of Data Source Name(DSN) , help needed urgent

416 byte By thottempudi9 at 2007-9-26 8:43:15
i am geting the following error, when i run the program[Microsoft][ODBC Driver Manager] Data source name too long the code that i have written is Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver ...

Help in retrieving date from Oracle Db

392 byte By lowfundaguy at 2007-9-26 8:43:24
I get error (saying the method is deprecated) when I try to do the following:int sysUseToDay = useResSet.getDate(5); (for getting the date from the database.How do I use Calendar or gregorianCalendar and get the date in any (say dd/mm/yy or yy/mm/dd or yyyy/mm/dd or dd/mm/yyyy) format from the ...

Load JDBC-Driver dynamically with JarClassLoader

2536 byte By woelli at 2007-9-26 8:43:33
Hey!I have a problem loading JDBC drivers dynamically with a JarClassLoader:Code:public class URLLoaderTest { public static void main(String[] args) { try {URL[] urlList = {new File("D:\\jbuilder5\\SQLServerJDBC\\lib\\mssqlserver.jar").toURL(), new ...

Concurrent use of JDBC objects

241 byte By ShagVT at 2007-9-26 8:44:12
Which objects in JDBC can generally be used concurrently?For example, can I use the same Connection object for two simultaneous calls or do I need to create new instances?How about using a PreparedStatement twice?

URGENT: rollback doesn't work

1083 byte By soledadvilla at 2007-9-26 8:44:57
I have two EJB, let's say ABean: session type = statelesstransaction type = containerBBean: session type = statelesstransaction type = beanBBean has only one method (getLastId(tableName)) which transaction attribute is RequiredNew and executes an update on the database that has to be committed ...

Oracle Thin Client

1841 byte By mzmrizu at 2007-9-26 8:45:53
New to java. I have the book "JDBC API Tutorial and Reference". Using jdbc odbc bridge was no problem. Now I am going back and trying to use the Oracle Thin Client. The code compiles, but I get the following exception when executing it:D:\TutorialDB>java CreateCoffeesSQLException: Io ...

JDBC Tracing

301 byte By zinkjo at 2007-9-26 8:45:58
I am trying the code below to capture JDBC messages in order to track down a CLI0125E error I am receiving. I see the file get created but it is empty. Any ideas ?ds = (DataSource)ctx.lookup("jdbc/mydsn");ds.setLogWriter(new PrintWriter(new FileWriter("jdbc.txt"))); ...

sub-query problem

527 byte By mortoza at 2007-9-26 8:48:09
HiI have write a sql query wherein i used 2 (two) sub-query to get data in order to insert into another table. It runs well and update the 2nd table but when the result of 1 (one) sub-query is nothing (may be null) even another sub-query has a value then updated value in 2nd table become null. ...

Working with PreparedStatement

647 byte By i.zahur at 2007-9-26 8:48:28
Hello ,I want to know how to use varbinary data in PrepareStatement using jdbc driver. I have tried to use setBytes() for setting parameter to prepare statement but it does not work, and it doesn't throw error. I got a resultset with no rows in it. I'm working in MS SQLServer 7.0 using ...

Problem when uploading the Image in Blob field of DB2 database

743 byte By akuthotav at 2007-9-26 8:48:39
I have the problem when uploading the Image into Blob column of the table....I have used the following code to upload the image...File file = new File(c:\\upload\\venu.jpg);FileInputStream fis = new FileInputStream(file);String query = "insert into tiva_users(userid, filename, filecontent) ...

database connection over the net

287 byte By mortoza at 2007-9-26 8:50:55
HiCan you advise how to connect a database system (say, MySQl, DB2, Oracle etc.) using the internet communication? For example, a clien computer in New york to connect Database server in California. Assume, no application server or web server is in use.Thanks

opening ms-access table thru Java program on button click.

171 byte By khiz_eng at 2007-9-26 8:50:58
Hi to all,Can anybody assist me as how to open ms-access table thru java program , when the button is clicked.Thanks in advance.khiz_eng

TableEample

618 byte By axa2001ro at 2007-9-26 8:51:41
Helllo! In demo/jfc/TableExample (Jdk 1.3) is an example about how should connect to a database server, get the data and put in a JTable. This example use the following files: TableExample (main), TableSorter ( for sorting the columns), TableMap, JDBCAdapter (AbstractTableModel)I tried to made ...

JDBC Drivers

171 byte By jeca at 2007-9-26 8:52:57
I reed Sun's online JDBC toturial. I have problem finding JDBC drivers. Are there any free drivers for MS Access? And where do I find them?Thank you!

Help needed, Applet-JDBC-Access

443 byte By jonx at 2007-9-26 8:53:05
Hi to everyone in the Java community.I'm new to JDBC...I have an applet which access an ACCESS database through JDBC ODBC bridge. ...try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}...But I got "java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver"I use IE. The webserver is ...

Help needed for Oracle Thin Client

1110 byte By spidy74 at 2007-9-26 8:53:19
Hi I had developed a server application that will start a thread when it had receive a request from a client. The server application kept a vector of connection to the Oracle Database through the oracle thin client. This vector is used by the different thread that is started upon the receiving ...

Help with JDBC drivers

281 byte By rachnajain at 2007-9-26 8:53:51
Our application requires that out Informix database resides on WIN NT and our java application, which accesses the database, resides on Linux. I need help in identifying as to which driver to use and how to connect to the database from Linux.Thanks in advance.

reading Blob leads to SQLException: Error allocating memory for data

2354 byte By koem at 2007-9-26 8:54:17
Hi,reading a previously stored zip-File (as Blob) results in this Exception (I am using DB2 on Windows connecting by ODBC):java.sql.SQLException: Error allocating memory for dataat COM.ibm.db2.jdbc.app.DB2RowObject.SQLBindColumns(Native Method)at ...

ORA-00020

650 byte By ljohan at 2007-9-26 8:54:54
Building a servlet that is asking a Oracle database a singel question i get the following error message back from the db:ORA-00020: maximum number of processes (50) exceededI do not think it is a problem in the servlet code because it is a very basic servlet asking something and using it in a ...

Help with JDBC drivers

443 byte By arized at 2007-9-26 8:55:14
I am working with postgresql 7.0.3 on Suse Linux v7.2 using the Forte for Java IDE. The built in driver which comes with the package does not seem to see any of the indexes and constraints placed on the tables. I have tried using another driver (JXDConDriver) but it does not detect my tables ...

Help with JDBC drivers

443 byte By arized at 2007-9-26 8:55:15
I am working with postgresql 7.0.3 on Suse Linux v7.2 using the Forte for Java IDE. The built in driver which comes with the package does not seem to see any of the indexes and constraints placed on the tables. I have tried using another driver (JXDConDriver) but it does not detect my tables ...

Help with memo fields

78 byte By Landarani at 2007-9-26 8:55:38
How can I store a file into a memo field via jdbc?Thanks.