Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Unale to get database connection (memory error) - odbc

801442Mar 31 2010 — edited Apr 1 2010
Hi,

On my Windows XP system Oracle database is running. I have amse net configuration to access
remote oracle database in oracle using local name method.

Java JDK 1.6 is installed on my system . From C:> prompt I am able connect remote oracle
server usning connection string. That is sqlplus <user>/<passwd>@connection string.

I am able to get SQL prompt of remote database on my windows syste. I access data also using
SQL query.

Now I created a java program to connecte remote databasse server and compiled it successfully.

the code is given below.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.io.*;
import java.sql.*;

class be_enq extends JFrame
{
JFrame fr;
Connection con = null;

public be_enq()
{
fr = new JFrame();
fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc:odbc:orcl","scott","tiger");
System.out.println("Connection Established");
}
catch(Exception e){e.printStackTrace();}
}
public static void main (String[] args)
{
new be_enq();
}

}

Here orcl is the data source name created on windows XP.
while running the program, I am getting the message , " Connection established" followed by

The instruction at "0x627241fd" referenced memory at "0x03dc007a".
The memory could not be "read"

Can any one help me to get out of this problem.

I searched microsoft site and installed hotfix to rectify this problem. Still the result is same.

Thanx.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2010
Added on Mar 31 2010
8 comments
341 views