my dog learned polymorphism*
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "window 7 64bit using database problem" Watch "window 7 64bit using database problem" New topic
Author

window 7 64bit using database problem

Ronak Trivedi
Greenhorn

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
Greenhorn

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: 171
    
    5

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
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ronak Trivedi
Greenhorn

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
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

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
Greenhorn

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(DbConnection.java:27)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: window 7 64bit using database problem
 
Similar Threads
Connecting Java Application with a Database
JBoss as service on 64 bit Windows server 2003
IP address
Spring program to save a record to a database using Hibernate
64 Vs 32 bit Windows