File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes window 7 64bit using database problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "window 7 64bit using database problem" Watch "window 7 64bit using database problem" New topic

window 7 64bit using database problem

Ronak Trivedi

Joined: Feb 23, 2012
Posts: 6
hello sir
I am Roank i am using windows 7 64bit in that i want to use database option for servlet program to run and save the database can you tell me what is the process of using oracle 8i or 10g or 11g how we save record
because here i am trying there is no get connection and not saving record
Vikrant Chougale

Joined: Feb 23, 2012
Posts: 1
Hello Ronak
you haven't specified how you are trying to connect to database means using odbc or database "url"
if you are using odbc connection you have to create DSN first to connect to database
and if you are connecting by url you have to specify servernam/databasename?username;password

Here I m giviing example i hope it will help you to solve yout proble

Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 208

Use the JDBC driver for connecting to oracle (ojdbc6.jar) and ensure it is included in your classpath. There are plenty of examples on this forum indicating the correct format for the connection string. Your first task is to connect to the database, you can't save records to a database without a connection. If you're getting errors, post the connection code you're using and the errors you're getting. Or if the problem is with saving records, the code and the errors for that. ItDoesntWorkIsUseless.

And welcome to the ranch Ronak and Vikrant!

Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

Vikrant, you should update your MySQL driver. That class has been replaced by com.mysql.jdbc.Driver a long time ago.

How To Ask Questions How To Answer Questions
Ronak Trivedi

Joined: Feb 23, 2012
Posts: 6
hello sir i am using this code for simple program to save the record and i am using Oracle 11g

Sir where i am underline there come error i think driver connection problem but i am using oracle11g in when i am create dsn that name is found and i am connect oradb11g_home1
but sir they never connect.

So sir please help me about this Error which name i will give there where i am underline
Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

Please UseCodeTags next time. I've added them for you this time. Since code tags don't support other formatting I've indicated where you underlined it in a comment.

You're using ODBC to form a bridge between Windows and the Oracle database. You need a DSN for that, called "Prod".
Instead of using ODBC, you should consider making a direct connection. You need to download the Oracle JDBC driver and use class oracle.jdbc.driver.OracleDriver. The URL becomes jdbc:oracle:thin:@SERVER:1521:DATABASE, where you need to replace SERVER with the server name where the database is running on and DATABASE with the database as it's called on the server.
Rachana Mistry

Joined: Apr 20, 2011
Posts: 3
Hi i am facing a similar problem .My Java app connects to MSSQL Server 2005 DB .The code works fine for 32 bit but does not work for 64 bit .I also tried creating a system DSN on 64 bit machine but getting an exception . please find my code below :

Exception :
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DbConnection.Connect(

I agree. Here's the link:
subject: window 7 64bit using database problem
It's not a secret anymore!