Lock a record

348 byte By pgoovaerts at 2007-9-26 8:57:01
Is it possible to LOCK a record after a 'Select ... for update' SQL statement is executed?I want to prevent user2 to get a record for update when it's already handled by user1. Instead, user2 must get a message that the record is already handled by another user.I really mean LOCK! User2 may ...

odbc mysql connection error

4137 byte By winstonralph at 2007-9-26 8:58:04
Totally new to Java and jsp but finally got it all set up except the mysql connection. Java, tomcat and apache are all working fine. Jsp pages are being served but when I connect to mysql i get the following error. I am sure that the drivers are set up properly and i'm running this on ...

Oracle JDBC Driver

234 byte By andreracz at 2007-9-26 8:58:53
Does anyone knows of a free Oracle JDBC Driver (except for the ones in the Oracle Web Site).I have searched for drivers, but all of them are above the limits of money for my project.Thanks.Andre Racz

DataSource doubt!

887 byte By varaprashanth at 2007-9-26 8:59:01
Hi all:I am trying to use datasource while connecting to a data base. So, I was following one piece of sample code and trying to get it working. Can someone explain what the myLogicalName stands for in the following code....how can I map it to a system DSN?try {Context ctx = new ...

JDBC Driver for MySQL database which should support JDBC2.0 function

1342 byte By lx2000 at 2007-9-26 8:59:47
Hi, Guys,I'm using JDK1.3 and mm.mysql-2.0.4-bin.jar in Windows NT. When I run following program, I got the error: java.sql.SQLException: ResultSet not updatable. (the function rs.last() is working).Based on the documentation, mm.mysql-2.0.4-bin.jar driver should support JDBC2.0 function, but ...

Increased # of cursors in Oracle cause AccessControlException?

2269 byte By martycash at 2007-9-26 9:00:04
I have a signed applet that connects to oracle using the thin client. I've been able to connect to the database for the last week until today. The database was shut down momentarily and the number of cursors were increased. Now, I get the same error that I got before I set up my policy file ...

Would this cause problems closing statements

2326 byte By aldus99 at 2007-9-26 9:01:08
public class Transaction {private List statements;private Connection conn;public Transaction(Connection conn) {this.statements = new ArrayList();this.conn = conn;this.conn.setAutoCommit(false);}public PrepareStatement prepareStatement(String query) throws SQLException {PrepareStatement stmt = ...

Order By Clause and Subquery

495 byte By hemag at 2007-9-26 9:01:18
Hi, I have a problem with subquery. I have 2 nested subqueries. It works fine without the order by clause, but i want the first sub query to be sorted by FIndex column. It says Error:ORA-00907: missing right parenthesis error.Please help.select FNo, Form from FMaster where FNo in(select FRef ...

Class.forName(jdbcDriver);

103 byte By giladsch at 2007-9-26 9:02:30
I get an error : classNotFoundException , I'll be glad if someone could help me.

MYSQL -SHOA TABLES

333 byte By axa2001ro at 2007-9-26 9:03:10
Hy! I Have a java application which should connected to a MySQL server, get data an put in a JTable. I am getting errors when I want to execute SHOW DATABASES or SHOW TABLES ( DESCRIBE TABLE instead work). It's not possible to execute those commands or I made a mistake somewhere?I use "mm" ...

Object Serialization(Materialization and Dematerialization)

2819 byte By jututj at 2007-9-26 9:04:08
I've encountered some issues with mapping my objects to an RDBMS and am hoping for some advice. I've tried various O/R mapping frameworks like Castor(too complex and too slow for my liking), JRF(nice but very repetitive and difficult to extend) and then some, but have yet to find one which ...

Simple Question: Where are the drivers?

326 byte By ac_santos at 2007-9-26 9:05:15
Hi all,When I do the following:Class.forName("com.inet.tds.TdsDriver").newInstance(); orClass.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); I'm loading the drivers from where?Thanks for any help,A. Santos ...

Oracle & BLOB/LONG RAW

1076 byte By robertpollai at 2007-9-26 9:06:08
Hi everybody,I need to store binary data (> 32K) in an oracle BLOB field, respectivly commit the data to an oracle PL/SQL stored procedure.First I tried to use LONG RAW, but failed to commit more than 32K of data. This seems to be a documented problem, you can store 2GBs in an LONG RAW ...

A silly question:where I can get the driver for MYSQL?

90 byte By dungali at 2007-9-26 9:08:35
MM.MYSQL web site cannot be connected. :(thanks for your help.

JDBC for Linux

289 byte By keroppi8 at 2007-9-26 9:08:56
I have a problem finding JDBC drivers. I can't find any JDBC driver for Linux under http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html. Are there any JDBC Driver for Linux? Are drivers for Solaris still suitable for Linux?Pls. help! Thanks!

JComboBox(Urgent!!!)

224 byte By pokemon2 at 2007-9-26 9:09:11
How to you retrieve date from the database,and implement it on to an interface with JComboBox?As in eg.12/03/2000,that appears in a dd/mm/yyyy format when retrieved from the database.Can someone please help me?

Connection Concurrency - Please Help

443 byte By irvingdi at 2007-9-26 9:09:59
Hi, I just want to confirm something....Ive seen some code that uses a shared connection in a (potentially) multi threaded environment.I just want to confirm whether or not Connection is supposed to be implemented in a thread safe manner or not (I'd expect not?).I'm also guessing that its ...

commit twice, is this possible?

449 byte By pgoovaerts at 2007-9-26 9:10:25
Is it possible to set applicationdefault to setAutoCommit(false) and afterwards do many 'commits' and even a 'rollback' for the uncompleted statements ?examplesetAutoCommit(false)...select * from...update record...commit...select * from...commit...select *from...update ...

Too Few Parameters. Expected 7.

880 byte By shadowcat1 at 2007-9-26 9:11:07
I get an error message :"Too Few Parameters. Expected 7." When I try to execute an update to an Access database.Can anyone help me with the meaning of this error mesage?here is the chunk of code which generates the error:try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con ...

Bug with java.sql.Date.valueOf(String st) Method

857 byte By anderat at 2007-9-26 9:11:29
Hello, I'm trying to convert a String in java.sql.Date using the method java.sql.Date.valueOf(String st). It's working with almost all dates, except from the day "2001-10-07". For example, the output of the application bellowpublic class Application {public static void main(String[] args) { ...

What is the best JDBC driver / RDBMS combo to use?

1228 byte By ezanga at 2007-9-26 9:11:44
I know this is a very vague question so let me clarify. . . .First I am new to java (its good to get that out of the way), but, second, I am very familiar with a variety of database platforms, including MS SQL Server, Sybase, Interbase, Oracle, MS access. . . .I am building a client-server ...

Class.forName()

611 byte By paynepro at 2007-9-26 9:12:39
Hello,I'm presently learning JDBC, I've done alot of examples for applications, as soon as I turned towards working with applets (appletviewer), I've had problems.I've study the tutorials on the web, and even with this example I found I'm getting errors.The error is in the try ..... ...

Calling via DSN from another machine

415 byte By m.pietro at 2007-9-26 9:12:57
HiI'm using thi code:String url = "jdbc:odbc:Mydb"; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection conn = DriverManager.getConnection(url);on thi manchine I have the DSN SystemMydb calling Test.mdbIt works, but now I want call this Database fro another PC on the same local ...

Problem updating data in a resultset: Oracle thin JDBC driver 8.1.7

2384 byte By vsolakhian at 2007-9-26 9:13:17
I am using Oracle's thin JDBC 2.0 driver release 8.1.7.I am trying to update/save a row in the User table using the following code fragment:try {statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);resultSet = statement.executeQuery("SELECT * ...

Help!! on displaying LONG RAW datatype from JDBC on Oracle

1013 byte By adu2000 at 2007-9-26 9:14:29
I need to display a LONG RAW datatype from Oracle into a JTable.I have used getBinaryStream method in the resultSet class. After some coversions, I got some 'garbages' and some characters. It looks like my code could not convert them 100% correctly. Here is segment of my test code: char [] ...

getBigDecimal and InterClient

548 byte By shawmike at 2007-9-26 9:14:31
I can't seem to make getBigDecimal() work with InterClient for Interbase. I realize that posting here may be a long-shot, but this is driving me nuts.I am trying to extract data from a ResultSet. The underlying column type is decimal(10, 3). InterClient throws some hoky exception when I try to ...

UserTransactions in Tomcat 4

87 byte By rand_mcneely at 2007-9-26 9:15:45
Does anyone out there know how to configure UserTransactions in Tomcat 4?

Insert and Update problem in MS Access

418 byte By tanveer_sattar at 2007-9-26 9:15:56
Hi folks,I am writing an application to insert some data in to MS ACCESS database. I have written some insert and update statements. These statements work fine if I run the application in debug mode, but don't update data if run as usual (although I didn't got any runtime exception). Any help ...

how to connect Applet to JDBC driver (urgent !!!)

494 byte By skitties at 2007-9-26 9:16:44
Hi,I had problems getting the applet connected to a database in the server using JDBC. When I run the applet in appletviewer I got the error msg :"Exception occurred during event dispatching:java.security.AccessControlException: access denied (java.lang.RuntimePermission ...

How to copy the structure of a db table?

1885 byte By san_dro at 2007-9-26 9:17:47
Hi all,i'm writing a client/server application. this is the problem: on the server's machine i have an Acces db (db.mdb) and i want to the client side a file *.mdb with the same structure. i tried to get the metadata from db.mdb, but i can get informations like: number of columns into db, ...

beginner with JDBC

288 byte By mdire at 2007-9-26 9:18:21
Hi,I work with Java 1.1.8 and I'm completely new with databases using JDBC.Please, tell me what I need to make a simple database in Java and put it in my web page.I am usin Linux Suse 7.2. I have access to a local server.Many thanks,Mihai

Java <=NT Authent=>MS SQL

459 byte By 1bigid at 2007-9-26 9:18:43
We have found several third party solution level 4 drivers that connect to a MS SQL databases. The question is, how to establish the connection. Q: does anyone have experience on how to use NT Authentication instead of SQL login? If so, how?I have only seen database logins deployed before. I'm ...

Executing many inserts

633 byte By Siggeman at 2007-9-26 9:18:55
Hi.I'm using DB2 7.1, jdk1.3.I would like to read from a file, and execute a large amount of insertstatements.Since Db2 "JDBC 2.0 compliant" driver cannot handle the addBatch command I think of using one large statement:i.e. INSERT INTO customer VALUES (...), (...), (...)... etcThis solution ...

Applet&JDBC: Exception, although web server tunnels database access

678 byte By BuckMulligan at 2007-9-26 9:20:54
Hi,I use the Oracle Connection Manager installed on my web server to access a database on another server to deal with the applet security restrictions. The Connection Manager works fine:- a simple applet, that uses standard rowset and oracle thin driver works perfectly when loaded from my web ...

MS SQL2000 JDBC driver, anyone tried it?

665 byte By freakytweaker at 2007-9-26 9:21:12
Hi everyone,Has anyone tried the JDBC driver from Microsoft? I've installed it and set CLASSPATH to all of the .jar files but my program still cannot find the SQLServerDriver.class! I then tried un-jar the files to verify the paths, etc, and it kept giving me an error on the mssqlserver.jar ...

ResultSet.last() problem

807 byte By gwofu at 2007-9-26 9:21:42
Hi All,I am having proble with the ResultSet.last() method.The query contains about 25000 records. Methods next() and prev() works fine.But last() hung.The client program is running on different machine from the Oracle database Server.Bellow is about what I ...

How to query cross-database?

442 byte By kymaym at 2007-9-26 9:22:04
I need do a query over a table on the connected database server and another table on another database server. How I can I do it in a easy way?Can you write you query as easily as:Select a, b from table 1, table2@server2 where a.c1=b.c1The other question is:If you close the database connection ...

IN OUT parameter and callablestatement

234 byte By joyfully at 2007-9-26 9:22:55
Hi,One of my store procedures have an IN OUT parameter. I know how to set IN parameter and OUT parameter in Java but what java method do I need to use to set IN OUT parameter? Thanks for your help.Joyfully.

IN OUT parameter and callablestatement

234 byte By joyfully at 2007-9-26 9:22:56
Hi,One of my store procedures have an IN OUT parameter. I know how to set IN parameter and OUT parameter in Java but what java method do I need to use to set IN OUT parameter? Thanks for your help.Joyfully.

Excel - Data source name too long

646 byte By uiranejeb at 2007-9-26 9:24:05
I need to connect to an excel file with a DSN-LESS connection, something like this:"jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\..."The error message that I get is "DATA SOURCE NAME TOO LONG".I read in documentation and I found that this error is happen because the setting of ...

MS ACCESS "*xx" searching trouble

507 byte By naushad_99 at 2007-9-26 9:24:13
Hi to Everybody, This is Naushad. I am using MS Access Database using JDBC_ODBC Driver for my Servlet form. The problem is this SQL."SELECT X, Y, FROM Z WHERE X LIKE '*a'";.It's just an example to show my sql structure. It work with no problem in MS ACCESS when you you quering, but fails in ...

insert string longer than 2000 characters into long raw

331 byte By dopsi at 2007-9-26 9:25:07
hii have to insert a string longer than 2000 characters into a long raw field, used prepared statement with string >= 2000 length know problems but longer no errors occurse at alli am not allowed to change the type of the field to a clob or sodoes someone knows a solution?thanx ...

MS Excel or a database?

270 byte By wazilian at 2007-9-26 9:25:47
can Excel be used instead of a database to access a small amount of data. and if so, is there much difference in code to connect and what driver should i use, the Bridge? no manipulation of data will be done, just storing and retrieving. thanx in advance.

creating DSn connecting database in the same drive)

645 byte By amin_rashid at 2007-9-26 9:26:00
Hi I am creating a DSn by Java prograameI have a Java file DSN.java where a fynction is written createDSN(String driverType, String dsnName, String filePath) I have all my .java files in D: Driveand when i am giving filePath asString fP = "\\folder1\\NameOfMyAccessfile.mdb"it is trying to ...

stored procedure truncation on unix and not on nt?

4623 byte By mdh883 at 2007-9-26 9:26:07
I am having problems with returning back a longvarchar(1298) of character data from a OS 390 DB2 V6.1 table. I am running on a Unix box under JDK 1.3 connecting to the mainframe via DB2Connect V7.1. I will either receive back a null from my callablestatement.getString() or extremely truncated ...

jdbc and MS Access Memo field

601 byte By namng at 2007-9-26 9:26:41
Hi,anybody know how to insert a memo field using jdbc. If it's a text field, i'd do like below:statement.setString(1, myStringHere);but this is a memo, and when myStringHere is longer than 255 characters, it gives me SQL error.But note that if I manually insert the long string into the MS ...

Updating a table with no Primary key

1157 byte By nimble99 at 2007-9-26 9:27:19
What I am trying to find out is if you can uniquely update a single record in a table that has no primary key. I see no way to reference the record I want, other than specifying all the field values in a where clause. This is a problem though, because if I have another record with the same ...

How do i know if the rs is null?

335 byte By lupe306 at 2007-9-26 9:28:20
Hello everybody...I'm connecting to an Access DB, when i submit a query, the resultset had to be null, but when i make an rs.next() in this method the program works like the rs is not an null resultset. I don't know another way to test if the resultset that i get back from my query is null. ...

Using a while loop to scroll thru a resultset

951 byte By Regulator1 at 2007-9-26 9:28:49
Hey ppl,I have a problem with scrolling through a resultset.Here is my code:while (rs.next()) {String username = rs.getString("USERNAME");int hours = rs.getInt("TOTAL_HOURS");ResultSet rs2 = stmt.executeQuery("select WAGES from WORK where USERNAME = ('"+username+"')");rs2.next();double wage = ...

how would u do this Urgent

403 byte By naslund26 at 2007-9-26 9:30:07
im trying to extend the class Calendar because Im obtaining a Datefrom the user to be then stored in SQL. My problem i extended classCalendar and when I call set it always stores a 1969 date. Doesanyone have code handy to share. I need to solve this. Im not surewhich methods i need to fill and ...