Access MS SQL 7.0 via JDBC

I am using following code to connect to the MS SQL database:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection("Provider=SQLOLEDB.1;" +
"Integrated Security=SSPI;" +
"Persist Security Info=False;" +
"Initial Catalog=Northwind;" +
"Data Source=KOLOSKOV");
please tell why it raises an SQLException: "No suitable driver". Or is any way to connect to the database without DSN creation.

Try this code
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection dbConnection = DriverManager.getConnection("jdbc:odbc:KOLOSKOV", "DataBaseUserID", "Password");

Similar Messages

  • Accessing Data from HTML DB via JDBC

    Hello, I am from Germany so please excuse my following mistakes in english.
    I built a web-application based on JSP, which connects to a local oracle-database 10g. web-server is tomcat. I use the JDBC-Driver from Oracle.
    Now I want to connect not to my local db but to a Oracle HTML DB, which already exists in the domain of my company. I know the workspace, the application-name and everything, which is accessible for an HTML DB admin. but no clue, what's important for connecting the database via JDBC.
    The hostname I got from the URL of HTML DB as well as the port. The main problem is to get the right database-name. I tried the workspace-name -> nothing, tried the application-name -> nothing. Honestly I tried everything, what I found.
    So my questions :
    -> Is there a chance to access the data created and used in the workspaces of the HTML-DB via JDBC (Java Database Connectivity)?
    -> How do I name the Workspace from outside?
    -> Are the login-accounts still applicable when connecting from outside via JDBC?
    I'm looking forward to get your ideas and help
    So far
    Kay

    Your English is very good. The hostname on the URL of HTML DB may not be the host on which the database rests. That is the host of the HTTP server. That server may or may not be the database server.
    Now your questions:
    -> Is there a chance to access the data created and used in the workspaces of the HTML-DB via JDBC (Java Database Connectivity)? What do you mean by "Data created and used in the workspace"? Do you mean the HTML DB repository which contains the application, page, and item definitions? (This is accessible via the schema that HTML DB was installed in.) If you mean the data a user creates when using an HTML DB application, then it is accessible through the application's parsing schema.
    -> How do I name the Workspace from outside? Outside the realm of HTML DB the workspace is not needed.
    -> Are the login-accounts still applicable when connecting from outside via JDBC? When you say "login-accounts" doe the mean the username/password users used to run the HTML DB application? These may or may not be database schemas. They may be HTML DB usernames or network usernames or LDAP usernames.
    I highly recommend you contact the DBA of the database you are trying to connect to and explain what you are doing. You should also contact the developer of the HTML DB application. They should be able to provide you with all the information you need.
    Mike

  • Importing Data from MS Access into SQL Serevr 2005 via Linked Server: User-Dependent failure

    I am operating an Express version of SQL Server 2005 on a Windows XP machine.
    I have successfully setup a linked server to a remote Access (.mdb) database. With my user account (Windows authentication) I can retrieve and store data without any problem.
    I have another user (apparently with same settings as my own account) that is always failing to get the data.
    The Error message he gets is:
    OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "TSU_Tmp" returned message "The Microsoft Jet database engine cannot open the file '\\DSITSO-NT0001\Exchange\Database5.mdb'.  It is already opened exclusively by another
    user, or you need permission to view its data.".
    Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "TSU_Tmp".
    Here below the code used to set up the linked server (coming from the Code Snippets of SQL Server 2005).
    EXEC sp_addlinkedserver
    @server = N'TSU_Tmp',
    @provider = N'Microsoft.Jet.OLEDB.4.0',
    @srvproduct = N'OLE DB Provider for Jet',
    @datasrc = N'\\DSITSO-NT0001\Exchange\Database5.mdb'
    EXEC sp_addlinkedsrvlogin
    @rmtsrvname = N'TSU_Tmp',
    @useself = N'TRUE',
    @locallogin = NULL,
    @rmtuser = N'Admin',
    @rmtpassword = NULL
    We both run the script, actually is a Stored Procedure, (see code below) on the same XP machine where SQL Server is running.
    EXEC('INSERT INTO tblFcst
    (StartBUCode, StartBUType, StartBUSeq, StartTrz, StartCty,
    EndBUCode, EndBUType, EndBUSeq, EndTrz, EndCty,
    FcstCreationPeriod, FcstValidForPeriod, Fcst, FcstExternalReference,
    IsProcessed, IsSolved)
    SELECT TSU.BUCodeSend, TSU.BUTypeSend, TSU.BuaNoSend, Null AS StartTrz, Null AS StartCty,
    TSU.BUCodeRcv, TSU.BUTypeRcv, TSU.BuaNoRcv, Null AS EndTrz, Null AS EndCty,
    TSU.[Current week], TSU.[Forecast for week], TSU.[Volume trp m3], TSU.[TSU_ID (Don''t touch me)],
    0 AS IsProcessed, 0 AS IsSolved
    FROM TSU_Tmp...tbl_TSU_trpm3 AS TSU;')
    PS: it is run using an 'EXEC(String)' format as at compile time of Store Procedure the Linked Server is not existing and otherwise compile would fail.
    We tried it with different files, in different locations. It always wors for me, never for him...
    The files were not used by anyone else. The folder(s) where they were stored are open to "Everyone".
    So I concluded it should be something linked to the User... :) But I really do not know what, as said apparently we have exactely the same setup in our Login profiles.
    Any idea or suggestion is welcome.
    Thanks
    Luca

    Hi Luca Lentati,
    According to your description and T-SQL statement, we need to verify if the download and install the Microsoft.Jet.OleDB.4.0 as a provider.
     If the 64bit SQL Server is running on the server,  The error, the Microsoft.Jet.OleDB.4.0 is not support, I reommend you download and install the Microsoft.ACE.OLEDB.12.0 as a provider.
    The error 7303 message indicates that the linked server does not have correct login mapping. You can execute the sp_helplinkedsrvlogin stored procedure to set the login information correctly. Also, verify that you have specified the correct parameters
    for the linked server configuration.
    In addition, if the issue still exists, I recommend you copy the access file to local Server, and create linked server between them , check if it can run well. If yes, it means that
     the account which SQL server uses to run the service does not have read/write access to that file share.
    There is an article about configuring a Linked Microsoft Access Server on SQL 2005 Server , you can review the following article.
    http://www.aspfree.com/c/a/Microsoft-Access/Configuring-a-Linked-Microsoft-Access-Server-on-SQL-2005-Server/
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to access PL/SQL data types through JDBC

    Hi,
    We have stored procedures written in PL/SQL. These stored procs take both IN and OUT parameters. The parameter types are both regular datatypes like NUMBER, VARCHAR etc. So far so good. I know how to handle these data types.
    Some of the stored procs also use parameters that are defined as composite data types like %ROWTYPE or %RECORD. How would I set the values of these data types? Can I use the oracle extension - support for Oracle Objects to accomplish this. If so please let me know with an example. If not any other suggestions or help will be greatly appreciated.
    Thanks
    Karthik
    null

    JDBC (and SQLJ) only support SQL types as stored procedure arguments, not PL/SQL types.
    If your stored procedure uses a PL/SQL-only type, such as BOOLEAN, record types, or index-by tables, then you cannot call it from Java (or, for that matter, from other languages as well).
    There is one exception: scalar index-by table arguments have been supported since JDBC 8.1.7 in the JDBC-OCI driver (refer to the JDBC manual for specifics).
    One workaround is to create wrapper PL/SQL stored procedures that take SQL arguments and convert them to PL/SQL -and vice versa- and call the original PL/SQL stored procedures. For example, a record type could be exploded into individual arguments, or it could be converted into a SQL object type, index-by tables could be represented as SQL collection types, etc.
    You can find a small example of this in the back of the JPublisher manual, where an example is given how to call a PL/SQL stored procedure that takes BOOLEAN arguments.

  • MS SQL Server 7 thru JDBC:ODBC bridge

    Hi,
    I am trying to access MS SQL server 7 thru JDBC ODBC bridge. I am finding my varchar data is being truncated to 255 characters. Any help on this would be appreciated.

    Any body know of a good type 4 jdbc driver for SQL
    Server 7. There is one for SQL server 2000
    downloadable from micrsoft site, but does it work for
    sql server 7 too ?Older betas of this driver suported SQL Server 7, but I believe the plan is to specifically remove that capability in its final release.
    My biased opinion would be to try the driver from DataDirect. http://www.ddtek.com Its their driver (an older version) that Microsoft has licensed for MS SQl 2000.
    Getting it from DataDirect has a couple obvious advantages:
    1. Its a later, more stable, better performing version
    2. It will continue to Support MS SQL 7
    3. It's suported by 24/7 phone,email and web tech support.
    4. And, early this week, you should be able to get the latest 3.0 release which promises to be even more robust, in addition to conforming to the new specs.
    5. its not free, but then again- you get what you pay for...

  • Accessing MySQL InnoDB tables via JDBC using Oracle SQL Developer

    I had posted a problem in the Oracle SQL Developer forum with how that application (v1.1) accesses MySQL InnoDB tables and someone replied that the "[data migration] team created the integration with MySQL", so I am posting here in hopes of learning more about the problem.
    Here's a summary:
    When I use Oracle SQL Developer to query MySQL InnoDB tables, I need to issue a "commit" before I do each query to ensure that I am getting current results. Otherwise, it appears to be using a snapshot as-of the last commit. Is this a problem with SQL Developer, or a JDBC configuration, or MySQL problem even?
    The full details are here:
    Re: MySQL InnoDB tables

    Hi,
    I've posted a response to your original thread.
    Regards,
    Dermot.

  • Execute anonymous PL/SQL block via JDBC - OUT parameter not available

    I have a simple proc on the database:
    CREATE PROCEDURE TEST(X OUT BINARY_INTEGER, Y IN VARCHAR) AS
    BEGIN
      X := 33;
    END; I am trying to invoke it via JDBC using an anonymous PL/SQL block:
            try {
                Connection connection =
                  DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL",
                    "scott", "tiger");
                CallableStatement stproc_stmt = connection.prepareCall(
                    "DECLARE\n" +
                    " X_TARGET BINARY_INTEGER;\n" +
                    " Y_TARGET VARCHAR(20) := :2;\n" +
                    "BEGIN\n" +
                    " TEST(X=>X_TARGET, Y=>Y_TARGET);\n" +
                    " :1 := X_TARGET;\n" +
                    "END;"
                stproc_stmt.registerOutParameter(1, Types.NUMERIC);
                stproc_stmt.setString(2, "test");
                stproc_stmt.executeUpdate();
                Object o = stproc_stmt.getObject(1);
            catch (Exception e) {
                e.printStackTrace();
            } No exceptions are thrown, but the Object o does not get the value '33' - it is NULL.
    Any ideas?
    thanks in advance,
    Mike Norman

    I think the issue may be in how JDBC parameter binding is being managed throughout the block's lifecycle.
    The slightly-different TEST2 works:
    CREATE PROCEDURE TEST2(Y IN VARCHAR, X OUT BINARY_INTEGER) AS
    BEGIN
      X := 33;
    END;
    try {
        Connection connection =
          DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL",
         "scott", "tiger");
        CallableStatement stproc_stmt = connection.prepareCall(
         "DECLARE\n" +
         " Y_TARGET VARCHAR(20) := :1;\n" +
         " X_TARGET BINARY_INTEGER;\n" +
         "BEGIN\n" +
         " TEST2(Y=>Y_TARGET, X=>X_TARGET);\n" +
         " :2 := X_TARGET;\n" +
         "END;"
        stproc_stmt.setString(1, "test");
        stproc_stmt.registerOutParameter(2, Types.NUMERIC);
        stproc_stmt.executeUpdate();
        Object o = stproc_stmt.getObject(1);
    catch (Exception e) {
        e.printStackTrace();
    }The order of the bind indices ':1' and ':2' are reversed in the above anonymous block - we are returning via ':2'.
    I am wondering if 'under the covers' there isn't perhaps a cursor issue. When the original block is parsed and the first bind index is found to be position 2, somehow we can't go back to position 1 - a forwards-only cursor?

  • 10G Forms connect to MS Access via JDBC

    A new project requires a 10G Form to connect to MS Access database. I understand 10G no longer connects to Access using ODBC. Will JDBC work? If JDBC can be used does anyone have a "How To" document or examples on how to connect orms 10G to MS Access via JDBC
    Thanks
    Ralph

    I dont think it will work. In 10g forms is going to implement transparent gateways.
    Is there a possibility of getting the data from MS access directly to Oracle database and then connect to Oracle DB from forms ?
    Rajesh Alex

  • Abap-table access via JDBC

    Hello,
    we have a java-program, that accesses data via jdbc to a mysql-database.
    Now we want to migrate the mysql-table to abap-table.
    How can we access from the  java-program to theese migrated abap-tables via jdbc?
    Regards Oliver

    Oliver,
    If you want to access those tables from SAP, then you have to use the Java Connectors (
    JCO).
    Please write the more details abount the java IDE and OS, which you are using I will send you appropriate help.
    Thanks

  • Accessing and retreiving ResultSets through CORBA via JDBC

    Hey,
    Im in the middle of doing a project and I was originally planning to connect to the database through JDBC over TCP/IP only. Everything worked fine. Now Ive been told that I have to use CORBA to relay the result sets over from the remote database. ie An applet requests information, queries the CORBA server, the CORBA server via JDBC then queries the database and gets the result set. The result set is sent back via CORBA to the client applet, where the data is then manipulated.
    What I want to know is it actually possible to do this? I only know a small amount of CORBA and Ive been crawling the web for even a small example of it. Could anyone help me out. Ive been looking for the past week and you guys are my last hope.
    Thanks in advance

    Hi,
    You won't be able to send actual instances of the Java class ResultSet via CORBA. All interfaces and data structures you use must be defined in CORBA IDL. You should be able to find a lot of tutorials about general CORBA, including the ones at the bottom of
    http://java.sun.com/j2se/1.4.1/docs/guide/idl/index.html
    You should define an interface in CORBA IDL for your server that the client applet will call. Probably you'll have a method which takes the query parameters and returns some sort of data structure that you also define in IDL.
    The only problem I really see is whether or not the JVM your browser uses does CORBA very well.
    - Everett

  • OS authentication in Oracle 10g via jdbc:oracle:oci

    I'm very much a newbie to Java / JDBC and I am trying, but failing, to connect with the database using OS authentication via jdbc, and hoping someone may help.
    My questions are:
    1. Is OS authentication supported for jdbc:oracle:oci with Oracle 10g ? I couldn't find a general statement of whether it works or not.
    (NB.The only information I managed to find, on another forum, is that it should be supported but there is a bug and so it does not work, but the author did not post all of his/her platform details, so the bug may only affect his/her situation. )
    2. If it is supported and works, could some one suggest what is wrong with my syntax . I could not find an example in any Oracle 10g/JDBC documentation.
    The details are as follows: -
    Database : - Oracle 10g Enterprise Edition 10.2.0.2.0 running on Solaris.
    Development platform : - NetBeans 6.1, JDK 1.6.
    Runtime environment: - JRE1.6 on Windows XP professional.
    OPS$ authentication : - the OPS$ accounts have been set-up and we use these successfully for PL/SQL and SQL Plus access.
    JDBC : - I can connect to the database with both jdbc:oracle:thin ( linking in ojdbc14.jar) and jdbc:oracle:oci by using username and password, so I know my JDBC library linkage is OK, eg. this works fine :
    final String url = new String("jdbc:oracle:oci:" + uname + "/" + pword + "@" + environment);
    where environment is the SID
    I have trawled the Oracle documentation which tells me that OS authentication is not supported for Oracle 10g for the jdbc:oracle:thin driver, so I have tried to connect with jdbc:oracle:oci driver using the following code :
    final String url = new String("jdbc:oracle:oci:/@" + environment);
    final Driver driver = new oracle.jdbc.OracleDriver();
    DriverManager.registerDriver(driver);
    final Properties props = new Properties();
    conn = DriverManager.getConnection(url);
    but this gives the following error :
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Other info: - The tnsnames.ora file contains nothing but there are entries in the ldap.ora and sqlnet.ora files.
    My questions are:
    1. Is OS authentication supported for jdbc:oracle:oci with Oracle 10g ? I couldn't find a general statement of whether it works or not.
    (NB.The only information I managed to find, on another forum, is that it should be supported but there is a bug and so it does not work, but the author did not post all of his/her platform details, so the bug may only affect his/her situation. )
    2. If it is supported and works, could some one suggest what is wrong with my syntax . I could not find an example in any Oracle 10g/JDBC documentation.

    If you specify the SID/service_name in the url, you are attempting to connect via SQL*NET and REMOTE_OS_AUTHENT must be set to true in the database. If you are connecting from the same host the database runs on, then just leave the SID off and make sure the ORACLE_SID environment variable is set.
    You can reproduce the same error you get in java with
    sqlplus /@SID
    SQL*Plus: Release 10.2.0.2.0 - Production on Fri Nov 7 12:14:08 2008
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    ERROR:
    ORA-01017: invalid username/password; logon deniedSample Code:
    import oracle.jdbc.pool.OracleDataSource;
    import java.sql.Connection;
    import java.sql.SQLException;
    public class conn {
      public static void main(String[] args) throws SQLException {
        OracleDataSource ods = new OracleDataSource();
        ods.setURL("jdbc:oracle:oci:/@");
        Connection conn = ods.getConnection();
        conn.close();
    }

  • Filesize a problem when uploading a file to Oracle via JDBC?

    Hello,
    I am trying to upload a file via JDBC to an Oracle Database (into a BLOB field). The file is converted to a byte array for uploading.
    While processing the request the following error is thrown :
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R Caused by: java.sql.SQLException: Datengr��e gr��er als max. Gr��e f�r diesen Typ: 485323
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.sql.SQLException.<init>(SQLException.java:52)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
    ("Datengr��e gr��er als max. Gr��e f�r diesen Typ" means: "Filesize bigger than maximum allowed size for this type")
    A blob is able to hold files with gigabyte size, a simple 460k file should not cause this JDBC error. I had a test with a 127k file, too, same error (different file types tested: html, doc, pdf, ...). Is this a problem of the driver or is there anythig I am doing wrong?
    Many thanks in advance for your help,
    Rommie.

    My problem is not to retrieve the file but to upload
    it. I checked the examples and only saw examples for
    retrieving a BLOB or CLOB, but not for inserting it
    into the database
    Maybe I am blind ... if so, please publish your link
    to the example.The page at:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.html
    Has a subsection that reads:
    LOB Datatype [19-Feb-2003]
    The term large object (LOB) refers to a data item that is too large to be stored directly in a database table. This sample application demonstrates how to read and write LOB datatype.The Oracle JDBC drivers provide support for two types of LOBs: BLOBs (unstructured binary data) and CLOBs (character data). BLOB and CLOB data is accessed and referenced using a locator stored in the database table.
    Download Now (ZIP, 76KB)
    Readme
    Source
    The zip is a standalone Java application that will create any needed tables, populate them with example data (both LOBs and CLOBs) from the data files in the zip and then put up a Swing gui that will allow you to add additional LOB and CLOB data to the table. Everything is there, the readme explains the 2 properties files you need to edit. The only other thing besides reading comprehension that you need to supply is DB connection information with the necessary privileges.
    The Source link is a link to the main code, but does not include all the code in the package. However, it contains the code to write CLOBs and BLOBs into the database.
    The Readme explains everything. It also has code excerpts, including the code used to read the sample data from file and write it into the LOBs and CLOBs.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/Readme.html
    Look for "loadSamples"

  • Lost index stats in Ora 8.1.6 Tables when selecting via jdbc

    Hi,
    i'm using JBuilder8 and Kylix2 on a Linux machine with Oracle oci drivers of client 8.1.7.
    The connect through JB8 jdbc via DBPilot is succesful and shows the tables of the db.
    After executing a select on any table the index stats of this table are lost.
    Kylix works fine without this failure.
    Thanks for any comments to this problem
    Jens

    Well, it's not the PL/SQL code that is causing a problem. Everything worked fine for many months. Then one day (without any changes in the environment or code) the update of a table from a java application (via JDBC) fails. The same update done directly on the DB with SQL Plus still succeeds!
    This led us to think that something is wrong with the JDBC connection (which was up for several months). Maybe a memory corruption?
    Anyone that experienced similar problems with JDBC?

  • Accessing MS Sql Server with Java classes - problem connecting to socket

    I found an example at this location which uses java classes to connected to MS Sql Server.
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    --bummer - it is a login location - so I will include the article
    Anyway, the example is using Websphere, but I am still on Jbuilder (will get wsad soon). So I planted the classes from the example in
    C:\Borland\JBuilder\jkd1.4\jre\lib\ext\...the classes
    Then I copied the code from the example to my jpx project and got an error that it could not connect to the socket. The only thing I changed in the code was the connection string:
    --original string from example:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    I was getting an error with the 2 argument version of DriverManager - and the second argument here was empty (properties argument). Here was my connection string:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    I am only using the 1 argument version of DriverManager. Note that the password=" is blank because my RnD workstation is standalone - no one accesses the sql server except me - so no password. I also left out the last semicolon I noticed. Any suggestions appreciated how I could fix this.
    Thanks
    source of article:
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    iSeries 400 Tips:
    TIPS & NEWSLETTERS TOPICS SUBMIT A TIP HALL OF FAME
    Search for: in All Tips All search400 Full TargetSearch with Google
    PROGRAMMER
    Sample code: Accessing MS SQL Server database from the iSeries
    Eitan Rosenberg
    09 Mar 2005
    Rating: --- (out of 5)
    Nowadays with the help of Java the iSeries can be integrated with other databases quite easy. This tip shows you how. The code included here uses the free Microsoft driver that can be downloaded from here. (SQL Server 2000 Driver for JDBC Service Pack 3)
    If your SQL server does not include the Northwind Sample Database you can find it here.
    http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en
    The download contains the following files:
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Those files needs to be copied to the iSeries directories (/home/r_eitan/ExternalJARs).
    Here's the directory structure (on the iSeries) for this sample:
    /home/r_eitan/ExternalJARs - Microsoft files (msbase.jar,mssqlserver.jar,msutil.jar)
    /home/r_eitan/JdbcTest02 - My code (Main.java,Main.class)
    The Java code
    import java.sql.*;
    import java.io.*;
    class Main {
    * Connect to Microsoft SQL server and download file northWind.products as tab
    * seperated file. (products.txt)
    public static void main(String args[]) {
    try {
    PrintStream outPut = new PrintStream(new BufferedOutputStream(new FileOutputStream("products.txt")));
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    System.out.println("Connection Done");
    connection.setCatalog("northWind");
    String sqlCmdString = "select * from products";
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery(sqlCmdString);
    ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
    int columnCount = resultSetMetaData.getColumnCount();
    // Iterate throught the rows in resultSet and
    // output the columns for each row.
    while (resultSet.next()) {
    for (int index = 1; index <=columnCount; ++index)
    String value;
    switch(resultSetMetaData.getColumnType(index))
    case 2 :
    case 3 :
    value = resultSet.getString(index);
    break;
    default :
    value = """ + resultSet.getString(index) + """;
    break;
    outPut.print(value + (index < columnCount ? "t" : ""));
    outPut.println();
    outPut.close();
    resultSet.close();
    connection.close();
    System.out.println("Done");
    catch (SQLException exception)
    exception.printStackTrace();
    catch (Exception exception)
    exception.printStackTrace();
    --------------------------------------------------------------------------------------------------

    My guess is that the server's host name isn't right. It necessarily (or even usually) the "windows name" of the computer. Try with the numeric IP address instead (type "ipconfig" to see it).
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
    - Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try it with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Is there any way of importing stuffs from Microsoft Access to SQL Server?

    I have quite a big store of information Microsoft Access DB, but now i am required to switch to SQL Server?
    Is there any way of importing to SQL Server, either by Java programming or manually?
    Thank you in advance.

    I like to give some tips on how to fulfil the requirement.. I haven't tried this. If you succeeded, it is well and good.
    1) Using Java:
    If you like to Java to import the data from MS Access to SQL Server, you have to write a JDBC Program in such a way that it has to retrieve the data from each MSAccess tables and store it in temperory java varaible.After writng into the temp. varaibles, the same thing will be written into SQL Server. The whole process is repeated for all the tables in MS Access.
    2) Manual Process:
    Try to get the data scripts from MS-Access for all the tables and Load the same into SQL Server
    I hope that Manual Process consumes less time compared in writing the codes for transformation..
    I hope that you got some idea on reading this. If you have any doubts, try to get back to me..

Maybe you are looking for

  • Itunes music files disappeared from HDD

    Hello, After an update of itunes for Windows (10.4.0.80), I found out that almost all of my music library disappeared from my hard drive. All music exist in itunes library, but when I try to play a song, a message appear telling me that the music fil

  • BIP 11g: Data Model Editor question

    In BIP 11g, when you create a parent query q1 and link it to child query q2, is it possible to refer to column from q1 in the select list of q2? Oracle Reports allows this and I am trying to re-create this Oracle Report to a BIP report and this does

  • N97 N-gage Problem

    Hello everyone, so far I have read many n-gage problems post with the nokia n97, but none of which I have read regarding the issue I have encountered.  I have downloaded and installed the n-gage application and there was no errors there.  However, th

  • How do I set up a mail archive from my Apple Mail app??

    Hi All, I am new to my Mac (Mavericks OS) and need to set up e-mail archiving. I understand there are some issues with Gmail but I am not using a Gmail account. My e-mail is on a UK2.net server. Thanks in advance Gary

  • On my third iPod classic, possibly failing hard drive, again

    i've been using 160gb ipod classics for a few years now, they're the most easily available and affordable music players for the amount of music i listen to regularly, and for a while they worked perfectly for me. after the first one i owned was stole