Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window 7 64bit using database problem

 
Ronak Trivedi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vikrant, you should update your MySQL driver. That class has been replaced by com.mysql.jdbc.Driver a long time ago.
 
Ronak Trivedi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic