SQLException:java.sql.SQLException:[Microsoft][Odbc driver for Oracle]

hi all..im tryin to connect to Oracle db from java application.. i can complile the code but when it comes to executing d cod im gettin d followin error.. pls help me out.. here is d error
SQLException:java.sql.SQLException:[Microsoft][Odbc driver for Oracle][Oracle]

henrymania wrote:
This is d driver im loadin..
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
and this is URL im assiging....
"jdbc:oracle:thin:@192.168.32.68:1521:test";
Here test is my sid name....highly unlikely, as that's not an ODBC driver nor is it an ODBC DSN.

Similar Messages

  • App failed due to java.sql.SQLException: [Microsoft][ODBC driver for Oracl

    Hello I developed a small applicaion for insert data into database.but i am getting exception in the server like this.
    app failed due to java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01401: inserted value too large for column
    And the code is given below..
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Jdbc1 extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    PrintWriter out=response.getWriter();
    String no=request.getParameter("no");
    String name=request.getParameter("name");
    String age=request.getParameter("age");
    try
    System.out.println("1");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("2");
    Connection con=DriverManager.getConnection("jdbc:odbc:rakesh","scott","tiger");
    System.out.println("3");
    Statement st=con.createStatement();
    System.out.println("4");
    st.executeUpdate("INSERT INTO ind VALUES('+no+','+name+','+age+')" );
    con.commit();
    con.close();
    catch(Exception e)
    System.out.println(" app failed due to "+e);
    }Please give solution for this....

    Hello sir..
    thanks for ur reply...
    for oracle 10g -----> we use XE as datasourse
    name..What?
    now i am using oracle 8i...Not so from the code you posted. Didn't I see "jdbc:odbc:..." in your first post?
    so what should i
    write...in the datasourse name...that means.......
    Connection
    con=DriverManager.getConnection("jdbc:oracle:thin:@loc
    alhost:1521:????????","scott","tiger");Do you really use the default username and password?
    What should i write in place of ?????????..The name of the database you wish to connect to, of course.
    Do you have your tnsnames.ora set up properly? Did you install this database?
    None of this has ANYTHING to do with the error you posted, of course. Fix that first and then worry about the thin driver. At least it appears that the code you posted managed to connect to the database.
    %

  • Java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle]

    I have just installed Oracle8i and i m trying to connect a project to d database using ODBC. I gave
    Driver class name as sun.jdbc.odbc.JdbcOdbcDriver
    Connection Info as jdbc:odbc:dbgen dbgen is my project name
    Database name as Oracle
    Username as scott
    Password as Tiger
    i am getting this exception
    java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle]
    can ne one help me out plz???

    hi
    dbgen is your project name? it should be the dsn name that has to be mentioned. Go to control panel->administrative tools>data sources and add the type of driver required.
    import java.sql.*;
    import oracle.jdbc.pool.*;
    public class TestThinDSApp {
      public static void main(String args[]) throws ClassNotFoundException,
          SQLException {
        // These settings are typically configured in JNDI
        // so they a implementation specific
        OracleDataSource ds = new OracleDataSource();
        ds.setDriverType("thin");
        ds.setServerName("dssw2k01");
        ds.setPortNumber(1521);
        ds.setDatabaseName("orcl"); // sid
        ds.setUser("scott");
        ds.setPassword("tiger");
        Connection conn = ds.getConnection();
        Statement stmt = conn.createStatement();
        ResultSet rset = stmt
            .executeQuery("select 'Hello Thin driver data source tester '||"
                + "initcap(USER)||'!' result from dual");
        if (rset.next())
          System.out.println(rset.getString(1));
        rset.close();
        stmt.close();
        conn.close();
    }Hope this helps to some extent..
    Edited by: S.Manikandan on Jun 21, 2008 10:07 AM

  • Result Sets with the Microsoft ODBC Driver for Oracle

    Howdy all.
    I have an Oracle database that I have migrated from MSSQL2K. My front end is mostly VB, and I have many (hundreds) DLL's that use ADO to access the database and execute stored procedures in the database. I cannot seem to get result sets from the Oracle procedures. I have tried passing a SYS_REFCURSOR as an IN OUT parameter, and I have tried returning a SYS_REFCURSOR in a function. The Microsoft ODBC Driver for Oracle does not seem to handle the ref cursors. If I use the Oracle ODBC driver, then ref cursors are handled sort of magically. Just like the result sets are in MSSQL with the SQL Server ODBC Driver.
    The question that I would like to pose to anybody willing to answer is this: Is there any way to use the Microsoft ODBC Driver for Oracle without changing the way I do the database access (using ADO connection/command/recordset objects)? I need the same DLL's to work on top of both MSSQL and Oracle.
    I know that what I want to do is possible using the Oracle ODBC driver, but this will take some major changes to some of my DB components. I am trying to stay away from this, but it looks like I am going to have to go that route - that is unless somebody wows me with a good answer to this post.
    wally

    As you are using Microsoft driver which works in XP and does not on Win 2003 you should post this on microsoft forum.

  • Database Connection Error 42000:[Microsoft][ODBC driver for oracle] Syntax

    Hi,
      This is Sathish, I am trying to create a report and retrieve data through stored procedure using ODBC Connection. When connecting to the Stored Procedure it is showing Database Connection Error 42000:[Microsoft][ODBC driver for oracle] Syntax error or access violation' Error.
    CRXI R2, Oracle 9i.
    What do i do to solve this issue.
    Regards,
    Sathish

    Hi Satish
    It could be an issue with the driver.
    You can try with the OLEDB n Oracle native connection to test if the issue persists.
    Also you can refer to the [Troubleshooting Database Connectivity for Crystal Reports|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/d05b3bb7-0f28-2c10-4ea3-84dbdc4e414e&overridelayout=true]
    Hope this helps!!
    Regards
    Sourashree

  • [Microsoft][ODBC driver for Oracle]Syntax error or access violation

    Hi,
    When I am trying to connect to Oracle 8.1.6 database using Microsoft ODBC driver for Oracle. The connection is established.
    But while creating CallableStatement, I am getting error "[Microsoft][ODBC driver for Oracle]Syntax error or access violation".
    What I need to do to resolve this problem.
    Raj

    Hi Satish
    It could be an issue with the driver.
    You can try with the OLEDB n Oracle native connection to test if the issue persists.
    Also you can refer to the [Troubleshooting Database Connectivity for Crystal Reports|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/d05b3bb7-0f28-2c10-4ea3-84dbdc4e414e&overridelayout=true]
    Hope this helps!!
    Regards
    Sourashree

  • 64 bit Microsoft ODBC Driver for Oracle

    Hi,
    Does Microsoft provide a 64 bit ODBC Driver for Oracle and where we can get it?

    GQ wrote:
    Hello,
    I am trying to create ODBC connection to Oracle 9i Database on remote server. I am using Windows 2008 64-bit but it is not showing Microsoft ODBC Driver for Oracle. Could any one suggest what to do?\\
    ThanksInstall the Oracle client and use the Oracle driver. You're going to need it whether you use the MS driver or Oracles. ODBC drivers do not work apart from the client of the underlying database product.
    When you do the install, you will need to do a custom install and specifically select for the Windows components.

  • Error: [Microsoft][ODBC driver for Oracle][Oracle]ORA-00917: missing comma

    hi
    i dont no why this error is coming. error may b while storing chaacter array in database
    program is
    //TCPClient.java
    import java.io.*;
    import java.net.*;
    import java.util.Calendar;
    import java.text.SimpleDateFormat;
    import java.sql.*;
    import javax.swing.*;
    class Client
         protected DataInputStream in;
    protected DataOutputStream out;
    //Jframe frame;
    public static final String DATE_FORMAT_NOW = "yyyy/MM/dd HH:mm:ss";
    public static String now() {
    Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
    return sdf.format(cal.getTime());
    public static void main(String argv[]) throws Exception
    String FromServer;
    String ToServer;
    int i=0;
    // frame = new JFrame("Show Message Dialog");
    Socket clientSocket = new Socket("localhost", 5000);
    BufferedReader inFromUser =
    new BufferedReader(new InputStreamReader(System.in));
    PrintWriter outToServer = new PrintWriter(
    clientSocket.getOutputStream(),true);
    BufferedReader inFromServer = new BufferedReader(new InputStreamReader(
    clientSocket.getInputStream()));
    String d=(Client.now());
    try{
    String cmd = "reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\"";
         Process p = Runtime.getRuntime().exec(cmd);
    Thread.sleep(200l); //terrible, the right way is p.waitFor
    InputStream in = p.getInputStream();
    byte[] bytes = new byte[16384];
    StringBuffer buf = new StringBuffer();
    while(true) {
    int num = in.read(bytes);
    if(num == -1) break;
    buf.append(new String(bytes,0,num,"UTF-8"));
    //output stored in a string
    System.out.println(buf.toString());
    String str=new String();
    str=(buf.toString());
    //formating output
    String newtext=str.replaceAll("HKEY_LOCAL_MACHINE","");
    String newtext1=newtext.replaceAll("SOFTWARE","*");
    System.out.println(newtext1);
    //getting local ip
    InetAddress thisIp =InetAddress.getLocalHost();
    String ip=(thisIp.getHostAddress());
    System.out.println("IP:"+thisIp.getHostAddress());
    // printing date and time
    System.out.println(d);
    // connection
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection("jdbc:odbc:cat","system","root");     
              PreparedStatement ps=conn.prepareStatement("select ip,dates,software from ipdet");
    ResultSet r=ps.executeQuery();
    char softlist[]=newtext1.toCharArray();
         for(i=0;i<softlist.length;i++)
    if(softlist=='*')
    System.out.println("\n");
         System.out.print(softlist[i]);
              Statement s=conn.createStatement();
              String ins="insert into ipdet(ip,dates,software) values(ip,d,softlist[i])";
              s.executeUpdate(ins);
    // s.setString(1,ip);
              //s.setString(2,d);
                   // s.setString(3,softlist[i]);
                   // s.executeUpdate();
    System.out.println("record inserted succcessfully") ;
              r.close();
              conn.close();
              clientSocket.close();
    catch (Exception e)
    System.err.println("Error: " + e.getMessage());

    i don't think its your connection. You must be hitting the DB otherwise you would not be getting an ORA error returned wrapped in an SQLException. I think its your pseudo-SQL, it simply says that you are missing a comma in an update string. Realistically, it could be that it is being misled into looking for a comma, probably because you have put a ';' at the end of your update string...

  • Where can I download the ODBC driver for Oracle 10g XE?

    where can I download the ODBC driver for Oracle 10g XE?
    I need the ODBC drivers for windows 7 x64, I installed Oracle Database 10g Express Edition, the use and connects with RazorSQL well, I just want to make a connection THROUGH ConnectionString language using the ODBC driver

    already checked these http://www.connectionstrings.com/oracle, I need Help Please.

  • ODBC driver for Oracle 8.1.5 in Unix

    Can anybody tell me , how will I make sure that ODBC driver for Oracle 8.1.5 installed in Unix ?.

    The Oracle ODBC driver is a Windows-only product. It won't install on a UNIX machine.
    Justin

  • Where can I find the ODBC driver for ORACLE XE

    Hi,
    Please help me in urgent. Where can I download the ODBC driver for Oracle XE?
    The OTN site I had visited but cannot find the suitable ODBC drive for Oracle XE, or (but, I am not sure) the ODBC 10g is suitable I had downloaded it but require Oracle Universal Installer to install.
    Message was edited by:
    user505611

    Have you checked the OTN site?
    http://www.oracle.com/technology/software/tech/windows/odbc/index.html
    Update: Drivers for 10g should work with XE. Can't say anything about the installation procedure, since I don't use/install ODBC.
    C.

  • Java.sql.SQLException:[Microsoft][ODBC Driver]Too few parameters Expected 1

    Hi friends,
    Greetings.
    i am trying to work with my inventory management system. My code is as follows and i getan error as follows:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 1.
    CODING:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class iteminsert extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    Connection con;
    Statement r,s;
    ResultSet rs;
    int flag1=0;//flag1 is for seeing if itemcode already exists
    String str1,str2;
    String s0=req.getParameter("itemcode");
    String s1=req.getParameter("itemname");
    int s2=Integer.parseInt(req.getParameter("unit"));
    int s3=Integer.parseInt(req.getParameter("minlevel"));
    int s4=Integer.parseInt(req.getParameter("rate"));
    int a=1;
    int b=0;
    res.setContentType("text/HTML");
    PrintWriter out=res.getWriter();
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:stocks");
    r=con.createStatement();
    s=con.createStatement();
    rs=r.executeQuery("select * from stock where itemcode='"+s0+"'");
    while(rs.next())
    flag1++;
    if(flag1!=0)
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM CODE ALREADY EXISTS!!!!</p><p>To insert an item with a different code, <a href=\"http://localhost:8000/stock/insert.html\">Click here</a> .</p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p></body>");
    else
    str1="insert into stock values('"+s0+"','"+s1+"',"+s2+","+s3+","+s4+","+a+")";
    str2="insert into stock values('"+s0+"','"+s1+"',"+s2+","+s3+","+s4+","+b+")";
    if(s3<=s4)
    s.executeUpdate(str2);
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM HAS BEEN INSERTED. HOWEVER REORDER LEVEL IS <b><u>MORE THAN</u></b> QUANTITY AT HAND</p><p>To buy more <a href=\"http://localhost:8000/stock/purchase.html\">Click here</a></p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p>");
    else
    s.executeUpdate(str1);
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM HAS BEEN INSERTED.</p><p>To buy more <a href=\"http://localhost:8000/stock/purchase.html\">Click here</a></p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p></body>");
    con.close();
    catch(Exception e)
    out.println("error"+ e);
    Please help. I have to use only Create statement and not PreparedStatement :(
    Thank You.
    Regards.
    Aravind

    your code is wrong on so many levels.
    you should not be embedding HTML in Java objects this way. wrong, wrong, wrong.
    JSPs are what you should be using.
    look at this line:
    rs=r.executeQuery("select * from stock where itemcode='"s0"'");the SQL query is supposed to be a bloody string. yours won't even compile.
    do it this way:
    PreparedStatement ps = connection.prepareStatement("select * from stock where itemcode = ?");
    ps.setString(1, itemCode);
    rs = ps.executeQuery();you don't close resources. you don't use code tags.
    too much wrong to fix here.
    %

  • Re: 32 Bit ODBC Driver for Oracle 11g 11.2.0.1.0

    Hi,
    Were you able to resolve the problem with these troubleshooting measures ?
    Please let me know since i am facing similar issues like yours.
    I am using a Windows 7 64 bit and from QTP installed on this machine ,  i am trying to connect to Oracle database.
    Now initially i installed a 64 bit ODBC for Oracle . But when i did that and ran the Script below :
    Set objDatabase = CreateObject("ADODB.Connection")
    Set rs=createobject("adodb.recordset")
    objDatabase.open "DRIVER={Oracle in OraClient11g_home1} ; DATA SOURCE=Oracle; SERVER= xyz ; DATABASE=abc1; UID=abc ; PASSWORD= abc123;"       
    rs.Open "select * from tablename", objDatabase
    'result1 = objDatabase.Execute("select * from tablename")
    'msgbox result1
    Do while not rs.eof
    print rs.fields("columnname")
    rs.movenext
    Loop
    print rs.fields("columnname")
    it gives me an error
    “[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application”
    So i am assuming that i need to install the 32 bit ODBC drivers for Oracle as well in addition to the already installed 64 bit drivers ..
    Any thoughts on this ?

    64 bit apps need 64 bit Oracle client software.
    32 bit apps need 32 bit Oracle client software.
    You should be able to tell the bit-ness of the app by checking the Process tab in task manager to see if it has *32 next to it.
    You can install both 32 bit and 64 bit Oracle client software on the same box, but you need to do it into different homes, and different oracle_base should also be used.
    There isnt an Oracle client install bundle that installs both, you'll need to do each separately.
    Hope it helps,
    Greg

  • Java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name no

    Hi,
    I am working with the following program. The same program is working with JBOSS but not with Tomcat-5. I am using MS-Access. Working with this program is very essential now. Please Help me.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class MDBGetData extends HttpServlet{
         Connection con=null;
         Statement st=null;
         ResultSet rs=null;
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
              PrintWriter out=res.getWriter();
              out.println("Connecting To data Base");
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:cmpny","sa","");
                   st=con.createStatement();
                   out.println("Connected to database");
                   rs=st.executeQuery("select * from cmpny");
                   while(rs.next()){
                        out.println(rs.getString(1));
              catch(Exception e){
                   System.out.println("Error While Creating The connection : " +e);
    }

    This is code for connect mySQL database:
    Connection con=null;
         Statement stmt=null;
         ResultSet rs=null;
         // Set up the JDBC connection
         try {     
              // Create
              InitialContext ctx=new InitialContext();
              ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
              con=ds.getConnection();
              stmt=con.createStatement();
              rs=stmt.executeQuery(sqlQuery);
    catch(SQLException e){
    Note: before you use these code you have to set datasource in tomcat
    I will show you how to do it next post.

  • Windows 7 - ODBC for Office 2010 64 bit - MS ODBC Driver for Oracle

    I am trying to link a table from an oracle rac 10.2.0.4 64 bit install.
    I have windows 7 with the oracle 64 bit client.
    in odbc i can create a datasource using the oracle driver
    and when i try to link a table i get an error :
    Reserved error (-7732); there is no message for this error.
    I would like to use the Microsoft ODBC for Oracle Driver but it doesnt exist on my computer.
    the old one on windows xp used file MSORCL32.DLL is there a MSORCL64.DLL now?
    Anyone have any help?
    Jeff

    Jam The Man's solution worked for me.
    >
    Here's the solution.
    My operating system is Windows 7 64-bit, using Office 2010 64-bit. Trying to connect to an ODBC data source through Excel. The data source is an Oracle9i 32-bit database on a Windows Server 2003 32-bit server. However, the database version or server operating system is arbitrary; it could be an 8i, 9i, 10g, or even an 11g 32-bit or 64-bit database on a UNIX or Windows server. If you're using Windows 7 64-bit and you want to connect to an ODBC data source through Excel to an Oracle database, you must use Office 2010 64-bit. You cannot use Office 2003 or 2007, for example.
    Follow these steps on your Windows 7 64-bit PC to connect to your ODBC data source.
    1. Through Oracle's web site, go to Instant Client Downloads for Microsoft Windows (x64). Currently, the address to that page is:
    http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winx64soft.html
    2. Download the two following files, found under the version 11.1.0.7.0 heading:
    Instant Client Package - Basic (instantclient-basic-win-x86-64-11.1.0.7.0.zip)
    Instant Client Package - ODBC (instantclient-odbc-win-x86-64-11.1.0.7.0.zip)
    3. Extract both zip files to the same directory (such as c:\oracle\instantclient_11_1).
    4. Launch the Command Prompt (DOS command window) by running it as administrator. Go to Start > All Programs > Accessories, then right click Command Prompt and select Run as Administrator.
    5. From within the Command Prompt, navigate to c:\oracle\instantclient_11_1, and run odbc_install.exe. You should receive a message saying Oracle ODBC Driver is installed successfully. The name of the new ODBC driver that was just installed is Oracle in instantclient11_1 -- use this driver when creating your ODBC connection.
    6. Create a new system environment variable. Set the value of the variable name as TNS_ADMIN, and the value of the variable path as the directory that contains the tnsnames.ora and sqlnet.ora files. On my PC, I have another Oracle client already installed which has its own tnsnames.ora and sqlnet.ora files. Therefore, I set the value of variable path as c:\orant\net80\admin (the directory that contains my tnsnames.ora and sqlnet.ora files). If you don't have another Oracle client installed on your PC, create a new directory such as c:\oracle\instantclient_11_1\network\admin, and place the tnsnames.ora and sqlnet.ora files in that directory. Then, set c:\oracle\instantclient_11_1\network\admin as the value for the variable path.
    7. To create the ODBC connection, go Start > Control Panel > Administrative Tools > Data Sources (ODBC). Alternatively, you can create the connection right from within Excel.
    Thanks man it worked for me.
    My host environment is windows 7 x64 ultimate and I have my oracle 10g in centos installed in VMware.
    Previously I had vista home premium x64 there instantclient 10.2 basic and odbc worked but in windows 7 it wasn't working.
    Thanks again.

Maybe you are looking for

  • Need to develop a calibration report

    Hi experts, i need to develop a report for calibration input screen parameters are equipment no. date output screen Equipment no. equipment description Functional location order no. inspection lot no. inspection reading before calibration inspection

  • Download old Instant Client Version 10.1.0.4 for Linux

    Hi to all, the downloads for version 10.1.0.4 of Oracle Instant Client for linux seem to be not available anymore. Where can I download the packages: instantclient-basic-linux32-10.1.0.4-20050525.zip and instantclient-sdk-linux32-10.1.0.4-20050525.zi

  • Mac mini freezes after software update install in leopard

    hello, ever since i purchased my mac mini 8 months ago, it freezes when installing a software update that requires a restart. it seems to get through the whole process, but then freezes with the default galaxy desktop (even though that is no longer m

  • How to delete all duplicate songs in Itunes in one step?

    How to delete all duplicate songs in Itunes in one step?

  • DAM IPHONE !!

    My phone is going crazy!!! It types what it wants to type camera, battery dying fast and flashlight not working either.  I reset the phone twice to factory reset and still not working. HELP PLEASE!!!!!!