Thin JDBC Drivers Insert Strings Incorrectly

Can anyone confirm or deny this.
I've downloaded the latest Oracle 8i JDBC drivers. If I create a table:
CREATE TABLE Moo (stringCol VARCHAR(10) NOT NULL);
and I try to insert an empty String into Moo.stringCol, the JDBC drivers try to insert Null instead! Yet if I try and insert a String of one character in length, it inserts it correctly.
Clearly it would seem the JDBC drivers are at fault.
Anyone come across this?

No, the drivers are performing correctly. In Oracle, an empty string in a varchar or varchar2 column is considered NULL. Regardless of what protocol or language you use to access the database, this will hold true.
Justin

Similar Messages

  • Upgrade 10G to use 10G thin jdbc drivers- OCI

    This is wierd...
    If I upgrade 10G app server to use the 10G thin JDBC drivers, and set up a data source to use the thin drivers, is there any way that I could score a[b] ORA-01010 invalid OCI operation error when I'm not using an OCI driver?
    Anyone else seen this...again, it makes no sense...

    You can not and should not use JDK 1.2 with 8i drivers.
    If you want to use JDK 1.2 drivers, download the 8.1.6 SDK
    from external site.
    Please, please, please READ the FAQ at www.oracle.com/java/jdbc
    before posting
    Premal Mehta (guest) wrote:
    : Hi,
    : Sorry for multiple posting. Previous posting has incomplete
    : information. Here's the whole scenerio...
    : I have Oracle 8i installed on my server. I have downloaded
    : JDBC drivers for Oracle 8i from Oracle site. When I try to run
    a
    : sample example from the demo files given, I get a Windows
    : internal Error "Exception: Access Violation (0xc0000005),
    : Address: 0x6ee0fb83". I am using Oracle 8i on Win NT 4.0 with
    : SP4, IIS4.0 with 128 MB RAM.
    : Also, I am trying to use OCI8 JDBC drivers with JDK 1.2. The
    : classpath is set for classes111.zip files.
    : I am unable to run applets with JDBC also. On using thin
    : drivers, it gives "SO Exception" error.
    : I have tried many options but it dosent seem to work.
    Please
    : help as this is very urgent.
    Oracle Technology Network
    http://technet.oracle.com
    null

  • IRIX and Oracle 7 Thin JDBC drivers

    I have a question I think I have the answer for, but I am just
    verifying it. The Oracel 7 Thin JBDC drivers will work on any
    platfrom including IRIx right? The reason I ask is the site has
    a download for Solaris and NT and I am not sure what the
    difference is. Anyway, if someone knows for sure it would be a
    great help to know.
    Thanks,
    Jesse
    null

    Which version of Oracle's JDBC driver are you using? Have you tried using the 8.1.6 version of our JDBC driver?
    Please also take a look at the FAQ:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#_11_
    null

  • Fees related to Thin JDBC drivers

    We have Oracle8. Are the JDBC drivers included. If not, how much will we have to pay to get these drivers.
    If they are freely available for download, I would like to have the URL.
    Thanks

    JDBC Drivers should come with the Oracle database (all versions - from Personal Oracle to the Enterprise Edition).
    From the OTN Downloads area (Select a Utility or Driver => Oracle JDBC Driver) several different versions of the JDBC driver (and of the SQLJ translator) are freely downloadable.
    You will get the JDBC thin drivers (all Java platforms) and the OCI drivers for Solaris and NT. Other platform-specific OCI drivers (if any) should come as part of the Oracle database distribution.

  • Support for Generated Keys in oracke jdbc drivers?

    Hi All,
    Anyone know when the Oracle Thin JDBC drivers are going to support generated keys?
    Regards,
    Lee

    Sure Justin,
    I should have made myself more clear. Sorry about that.
    I have a sequence for generating primary keys in a particular table, and a trigger to replace a null in my insert query with the nextval. That all works fine. I would like to use the DB-neutral means of getting a generated primary key...
    prepStmt = connection.prepareStatement(insertSQL, Statement.RETURN_GENERATED_KEYS);
    prepStmt.executeUpdate();
    ... and later ...
    ResultSet generatedKeyRS = prepStmt.getGeneratedKeys();
    ... etc.
    I am aware that I can get this information several other Oracle9i-specific ways, including using the sequence's .currval and creating a callable statement that returns the primary key column. However I would still like to use the nice, neat, vendor-neutral JDBCv3 way. Call me pedantic.
    Regards,
    Lee

  • Can't download JDBC Drivers

    I've been unable to download Oracle's latest thin jdbc drivers for the past several days. Is anyone else having this problem???

    I've been trying for a couple of days now -- ftp connections to ftp.oracle.com technet.oracle.com and download.oracle.com reveal the same FTP server, and it's completely empty.
    This is going on 4 days now, and I have to wonder why I'm spending this ludicrous amount of money on software from a company that can't get its FTP server up within 4 days that I know of, who knows how long it's been in this state.
    To charge the amount of money Oracle is for its software, you'd think there'd be at least a remotely helpful level of support -- at least available downloads.
    null

  • JDBC DRIVERS FOR LINUX (8.1.6)

    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    Where can a person download the JDBC Drivers (CLASSES12.ZIP ORA)
    for Linux? I see information on Solaris and NT but not Linux.
    - Server name
    - Filename
    - Date/Time
    - Browser + Version
    - O/S + Version
    - Error Msg
    Connie

    if you have oracle 8i server you will find the classes12.zip(thin jdbc drivers )in the [ORAHOME]/jdbc/lib directory. You have to added the zip to the classpath in the jserv.properties file eg. wrapper.classpath=D:\oracle\ora81\jdbc\lib\classes12.zip(if you orahome is D:\oracle\ora81.)
    otherwise for just using the java classes for compiling and running in the consile you have to set the classpath of classes12.zip in your system environment.
    Thanks.

  • Thick vs. Thin JDBC Driver

    Hi!
    I was just wondering where to find some info about
    the advantages / disadvantages of the Thick and Thin JDBC drivers, please, and some bachground about those drivers (what is the differnence etc).
    In particular I would like to know whether Thick drivers are errorprone and mix up the contents of threads. Is this so according to your experience?
    I would also like to know which one is the recommended driver to use if speed is an issue...
    We use Oracle 8.1.7.4.0 and Websphere Application Server 4.04
    Thanks a lot!
    Cheers,
    Steffen

    Hi Steffen,
    Check these links. I hope they provide you the information required.
    http://st-doc.us.oracle.com/9.0/9202/java.920/a96654/overvw.htm#1000908
    http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/factsht.htm
    Regards,
    Anupama

  • Oracle 8.0.6 JDBC Drivers download

    We are working with an Oracle 8.0.6 Database installed in a Sun Solaris machine.
    Now we need to execute a batch program in a Windows 2000 PC. We wanted to know if we can use the JDBC Drivers used in the Sun Solaris version or we have to download another class files.
    Thanks a lot.

    Ok i have solved the problem. I tried playing with the URL string, and started getting a Refused error along with the other erros. I noticed that i was not using the oracle user/pwd instead was using unix user/pass. I was also using the wrong tnsname that didnt match the IP.
    I changed that and
    String url = "jdbc:oracle:thin:@<database>";
    where <database> is
    @IP:portno:tnsname
    and wooolllaaaa it worked.

  • JDBC Bulk Insert to MS Access

    I am trying to do bulk insert to MS Access database from text file. One of the solutions recommended by bbritta is as follows
    import java.sql.*;
    public class Test3 {
      public static void main(String[] arghs) {
        try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          String filename = "C:/DB1.mdb";
          String database =
              "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/DB1.MDB";
          Connection con = DriverManager.getConnection(database, "", "");
          Statement statement = con.createStatement();
          statement.execute("INSERT INTO Table1 SELECT * FROM [Text;Database=C:\\;HDR=YES].[TextFile.txt]");
          statement.close();
          con.close();
        } catch (Exception e) { e.printStackTrace(); }
    }Whenever I try to use that approach, I get error message
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
    Fields in Access destination tables are exactly the same as in text field and I still get an error message. I could manually import to Access from same file without any problem.
    I was wondering if someone out there could suggest another approach.

    >
    1) Is there a type-4 JDBC connector available to
    connect directly to MS Access databases and if so
    would it be difficult to implement or migrate to?
    This is important because dbAnywhere does not appear
    to be supported on Windows 2000, which is the
    platform we are migrating to. We need to eliminate
    dbAnywhere if possible.
    By definition no such driver can exist. A type 4 driver is java only and connects directly to the database. Excluding file writes the only connection method is via sockets and there is nothing for a socket to connect to in a MS Access database - MS Access doesn't work that way.
    You can look into type 3 driver. I believe there are a number of them. They use an intermediate server. Search here http://industry.java.sun.com/products/jdbc/drivers
    You could implement your own using RmiJdbc at http://www.objectweb.org/. However I personally would think that that would require a serious long look at security issues before exposing a solution to the internet.

  • OAS and using JDBC-drivers from EJB

    Hi.
    I have a problem with accessing the database from EJB-components
    deployed to OAS 4.0.8. The database is 8.1.5-version. I'm trying
    to use a connection exactly like it is documented in OAS-EJB-
    documents, the connection string looks like this:
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:jts8:@ora8i");
    And this is the error that above sentence it generates:
    "Sub Protocol must be specified in connection URL".
    The DAD(ora8i) is created in OAS.
    Now, I don't even know if this uses JDBC/OCI or thin since the
    documented connection-string doesn't contain that information. I
    quess it must use OCI-drivers, at least I should use them and
    they should be installed with OAS.
    So:
    * I should use only jts-enabled JDBC-drivers when developing EJB-
    components, is this right?
    * How can I connect to the database (from OAS 4.0.8 to Oracle
    8i), the string please?
    Thanks,
    [email protected]
    null

    Hi Suresh,
    There is lot of Documentation available on this, check these links
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/07d2eeea3e0485e10000000a155369/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/08546ff5200486e10000000a155369/frameset.htm
    Venkat.

  • JDBC Drivers for Oracle9i

    Does anyone know if I need a different JDBC driver for Orcale9i besides classes111.zip???? If so... wher can I get it once Oracle website does not contains it?
    Thanks
    Siomara

    Thank you for this great answer. I think its given me an idea of what to do:
    So if I have you right, I could "trick" the database into treating my UTF-8 byte sequences as US7ASCII by putting the JVM in that encoding by default (ISO8859-1 or something) which should force the oracle think
    driver into that mode. Then when I go to do the insert into the DB, I get the bytes from the unicode string as UTF-8 and stick them into the database. The trick is to be able to pull out the UTF-8 bytes later as
    create java Strings that are UTF-8 encoded instead of relying on the automatic JVM encoding to do it for me.
    Sounds convoluted, right? Basically I'm trying to understand how this works so well with my old setup where I've been sticking UTF-8 in/out
    of the US7ASCII-formatted DB for months while being blissfully ignorant of it all. So when you say:
    If you have an invalid US7ASCII value in the database (a value 128-255), the conversion fails and you get garbage.I know that somehow my US7ASCII-based database table is storing the ordinal values 128-255 and spitting them back out correctly-- that is, there is some combination of a 1.2.2 VM that thinks its in ISO8859-1 encoding and the Oracle 8.1.7 thin jdbc driver on an US7ASCII database
    is doing the right thing from the perspective of getting data in and out.
    Thoughts?
    Thanks by the way again-- this is a great education
    AR

  • Inserting strings in a database

    Hello all!
    I am trying to insert string values in a database with this metode.
        public void insertData(){
       try{
    String url = "jdbc:odbc":"+database;
    Connection connection = DriverManager.getConnection(url, user, password);
    Statement status = connection.createStatement();
    status.executeUpdate("INSERT INTO radiograhy (Title, Red, Green, Blue,"
    + "Hue,Saturation,Value,Color,Path,IdRadiography,Description) VALUES "
    +"("+Title+","+Red+","+ Green+","+ Blue +","
    + Hue+","+Saturation+","+Value+","+Color+","+Path+","
    +IdRadiography+","+Description+")");
    }catch(SQLException e){
    e.printStackTrace();
    System.out.println(e);
    but the metode throws me an exception :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

    This has actually nothing to do with JDBC, but with basic SQL knowledge.
    Print the complete query using System.out.println and try to find out what's wrong with it. Play with it, execute it right on the DB, etcetera. If you don't understand it, then don't bother to read some SQL tutorials how to write clean SQL.
    Once you understand SQL, I would also recommend you to use PreparedStatement instead.

  • Inserting strings over 2000 in length

    Hi,
    I'm trying to populate a database table which contains a long and
    I've been running into two Oracle errors:
    ORA-01462: cannot insert string literals longer than 2000
    characters
    and
    ORA-01489: result of string concatenation is too long
    Can someone point me to documentation or a solution of how you
    can get a 29k string into the database? I have code regarding how
    to use LOBs, but I'm unfamiliar with any stored procedures which
    will allow you to append to a long column with new content. I
    need to use long for the project I am working on.
    Thanks in advance for your help!
    Jill
    null

    Hi Ralf,
    If you read the documentation on
    http://java.sun.com/products/jdbc/index.html you will
    find a statement saying that the JdbcOdbcDriver is
    only for test and experimental use.Yes, but my and other's experiences with the JDBC-ODBC bridge itself are very well.
    Since it is only a bridge over the specific vendor's ODBC driver, you are limited to the capabilities of that.
    But the bridge is not to blame for this.
    For MS products you may reach efforts by updating to an actual MDAC version.
    Nethertheless, with MS ODBC there are some problems.
    Search the driver database (a link is on the above web
    page) for another (commercial) driver. I recommend the
    type 4 driver from i-net.Ok.
    Have you tried out that error David reported with the i-net driver?
    I use JDBC-ODBC with MS SQLServer 2000, actual MDAC, and I get that error with PreparedStatement.
    But it's all ok with a normal statement.
    So if you could test them both with the i-net driver, we would see if it's again the MS ODBC driver.
    Regards,
    Ralf SchumacherI think, I'm not the first you asks this:
    you are not the quick one we saw in Suzuka on Sunday, are you?

  • Need information on Weblogic JDBC drivers

    Hi,
    I have been using Weblogic 8.1 sp5 with oracle version -Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production.
    Lately i have observed the below error:-
    <Jun 2, 2009 9:56:58 PM MEST> <Error> <JDBC> <BEA-001112> <Test "SELECT 1 FROM DUAL" set up for pool "WIS03 JDBC Connection Pool" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state.".>
    This may be linked to the JDBC drivers used with weblogic.
    At weblogic console i can see the list of drivers as - Oracle Driver (Thin) Versions.9.0.1,9.2.0,10
    Is this driver good for the Oracle version 10 g?
    I am clueless for the above exception. Please suggest.
    Thanks & Regards
    Himanshu Tageja

    Thanks Joe.
    I have found the latest ojdbc.jar, below are the detials mentioned about this jar in the manifest.mf:-
    Oracle Database 10g Release 2 (10.2.0.4) JDBC Drivers
    Specification-Title: Oracle JDBC driver classes for use with JDK14
    Sealed: true
    Created-By: 1.4.2_14 (Sun Microsystems Inc.)
    Implementation-Title: ojdbc14.jar
    Specification-Vendor: Oracle Corporation
    Specification-Version: Oracle JDBC Driver version - "10.2.0.4.0"
    Implementation-Version: Oracle JDBC Driver version - "10.2.0.4.0"
    Implementation-Vendor: Oracle Corporation
    Implementation-Time: Sat Feb 2 11:40:29 2008
    Now the issue is with respect to the Java_version used for this jar which is 1.4.2_14 (Sun Microsystems Inc.)
    but my weblogic server uses jdk142_08.
    I have done quick tests after replacing the jar from the server/lib directory and seems no issue but can the differences in Java version lead to potential issues in future?
    Awaiting your valuable response.

Maybe you are looking for

  • Error message "Enter a Printer" when the user clicks on PO out put preview

    Dear SRM Gurus, We are using SRM 5.5 extended classic scenario. When the user presses on Output Preview of PO we are getting a message that "Enter a Printer" and not able to see the preview. This messge we are getting for some particular PO's and for

  • Cfx_imsmail

    I know this probably isn't the best place to post about this, but I'm having all sorts of problems using the forums at coolfusion.com, and the listed support email addresses kick back as being non-existent.  If this is an inappropriate place for this

  • Problem Syncronizing Folder in V. 5.4 (and 5.3)

    Hi - I first noticed this in version 5.3, and hoped that version 5.4 would fix it but it hasn't. I am running Win 7 64 bit professional. No apparent issues with hardware. Optimized the catalog a few days ago. In the Library module, if I point to a fo

  • Function not available to this responsibiltiy

    Hi, When i am trying open responsibility "Counter template" getting error like "Function not available to this responsibility Change responsibilities or contract your System Administrator" Could any one please help me how to debug this error.

  • P43 Neo3-FR no booting :cry:

    My specs are: MSI P43 Neo3-FR Intel Core2Duo E7300/E8400 Boxed versions (standard cooler) 2x1 GB PC-2 5300 DDR2-667 CL=5-5-5-15 500GB Western Digital Harddisk ATI Radeon ASUS EAH4850/HTDI (512MB) PCI Express 2.0 x16 / 625 MHz / 3840 x 2400 / 512 MB D