From acces database tu Java db

hi, i have this problem, i have a project that works just fine using an Acces database , i would like to replace this database with a Java DB Derby database, the database i have already did it, but i can't connect to it, i don't know how to change the lines for this new database, here is the present code:
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:dbruota", "", "");
java.sql.Statement st=c.createStatement();
ResultSet rs;
String sql;
sql="select count(*) from ruota";
rs=st.executeQuery(sql);
rs.next();
max=rs.getInt(1);
i have tried :
try
Class.forName("org.apache.derby.jdbc.ClientDriver");
Connection c=DriverManager.getConnection("jdbc:derby//localhost:1527/dbruota","","");
java.sql.Statement st=c.createStatement();
ResultSet rs;
String sql;
sql="select count(*) from ruota";
rs=st.executeQuery(sql);
rs.next();
but it does not works, thank you very much for your time.

yes, of course, as i said , the old code works fine, the new one (in wich i changed only the two lines of the class and connection):
* To change this template, choose Tools | Templates
* and open the template in the editor.
package javaapplication3;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
* @author Ciprian
public class Interogadb
     private int max;
public Ds[] dom()
          Ds[] p;
          String s1="",s2="";
          int n,nr=0;
          p=new Ds[1];
          try
               Class.forName("org.apache.derby.jdbc.ClientDriver");
               Connection c=DriverManager.getConnection("jdbc:derby://localhost:1527/ruota", "", "");
               java.sql.Statement st=c.createStatement();
               ResultSet rs;
               String sql;
               sql="select count(*) from ruota";
               rs=st.executeQuery(sql);
               rs.next();
               max=rs.getInt(1);
p=new Ds[max];
               rs.close();
               for (int i=0; i<max; i++)
                    try
                         do
                              n=casuale();
                         while(cont(n,p));
                         sql="select coddomanda,domanda,suggerimento from ruota where coddomanda=" + n;
                         rs=st.executeQuery(sql);
                         if (rs.next())
                              nr=rs.getInt(1);
                              s1=rs.getString(2);
                              s2=rs.getString(3);
                         rs.close();
                    catch(SQLException sq)
               p=new Ds(nr,s1,s2);
               st.close();
               c.close();
          catch(SQLException sq)
          {sq.printStackTrace();}
          catch(Exception e)
          {e.printStackTrace();}
          return p;
     private int casuale()
          int i;
          i= (int)(Math.random()*max)+1;
          return i;
     public boolean cont(int n, Ds[] vett)
          for (int i=0;i<vett.length; i++)
               if (vett[i] != null)
                    if (n==vett[i].getcod())
                         return true;
          return false;
gives the next error on the console:
compile:
run:
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at javaapplication3.Interogadb.dom(Interogadb.java:30)
...... and so on..
thank you

Similar Messages

  • How to read data from SAP database in java?

    Hi All ,
    I want to read some tables from SAP database in java? How to connect to SAP database in java.I want to read the data from SAP NetWeaver BW 7.3.
    Please help..

    Download Vder [http://binhgiang.sourceforge.net/site/download.jsp|http://binhgiang.sourceforge.net/site/download.jsp]
    Extract date from website, output to xml format then save to database (MySQL, Oracle,...)
    Screenshot: [http://binhgiang.sourceforge.net/xmlalbum/screenshots.html|http://binhgiang.sourceforge.net/xmlalbum/screenshots.html]
    Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:55 PM
    Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:56 PM

  • Getting specific values From a database in Java

    Hey,
    I'm using XE and building an application in Java to do basic CRUD operations on the database.
    One of these operations is searching for a customer by last name (which runs fine) and the result of the query (a customer ID, a first name, and a last name) is displayed in a JTable. I want to be able to click on the record I need and use the customer ID to do an insert on another table CUSTOMER_PURCHASES which maps purchases to customers.
    How do I go about doing this knowing that customer ID is an auto-incremented number (using a SEQUENCE)?
    I thought about creating a variable in Java of type String called customerID and initialize it like this: String customerID = "CUSTOMER_SEQUENCE.nextval"
    But by doing this, I suspect that I'll be getting the next available customerID, not the one from the record I selected.
    Can anybody suggest a workaround or lead me in the right direction?
    Thank you in advance for the help and sorry about the long post, but I'm a newvbie to this field.

    As per raychen's advice, I was able to get the image from the database and bring it over into JavaFX.
    In my java class I retrieved the image as follows:
            BufferedImage image = null;  //Buffered image coming from database
            InputStream fis = null; //Inputstream
            try{
                ResultSet databaseResults;  //Returned results from DB
                stmt = conn.createStatement(); //Create the SQL statement
                databaseResults= stmt.executeQuery("SELECT * FROM mydb.`user` WHERE userID = 'username';"); //Execute query
                fis = blah.getBinaryStream(3);  //It happens that the 3rd column in my database is where the image is stored (a BLOB)
                image = javax.imageio.ImageIO.read(fis);  //create the BufferedImaged
            } catch (Exception e){
                     //print error if caught
           return image  //My function returns a BufferedImage objectSo in JavaFX, depending on how you have it set up, you essentially get the returned BufferedImage and create the image as follows:
    var bufferedImage : BufferedImage = theJavaFunctionThatReturnsABufferedImage();
    var newImage : Image = javafx.ext.swing.SwingUtils.toFXImage(bufferedImage);  //BufferedImageCheers and Happy New Year.

  • Call EJB From Oracle Stored proc or Database loaded Java?

    Are there any examples of calling an EJB, residing in the OC4J on a machine separate from the DB server,
    from an Oracle PL/SQL stored proc.
    The Stored proc can call java loaded into the DB. That java makes the intial bean context. Or another way if suggested.
    The reason is that I need to use some drivers that I have so far been unable to load directly into the DB using
    loadjava util. I plan on using the driver in the EJB, located on a different machine. But I'd like so know if its possible to
    make the IntialContext call to the EJB container from PL/SQL. Are the OC4J drivers loadable to be
    able to be called from a database loaded java class? ( I might be a little off on my terminology)
    Bob
    [email protected]

    Hi Bob,
    Your question has been previously asked on this forum many times already.
    You can probably find the relevant postings by doing a search of the
    forum archives.
    To summarize those posts, as I understand it, the latest version of OC4J
    (version 9.0.3) contains a "oc4jclient.jar" file (I think that's the name
    of the file), that can be loaded into the Oracle database (using the
    "loadjava" utility), and which allows a java stored procedure to invoke
    methods on an EJB residing in OC4J.
    Please note that I have not tried any of the above -- I am only summarizing
    for you what has already been posted. And like I said before, a search
    of the forum archives will probably give you more details.
    Good Luck,
    Avi.

  • How to extract payload data from SOA database schema using Java

    I am trying to extract the payload data and output as XML text files using Java. Seems that is stored in SOA table XML_DOCUMENT. I am trying the following Java code to get started and it's not working as I would expect. I only get a few actual lines of output and, when I do, I only get the *<?xml version ... ?>* line.
    I appreciate any advice to extract the payload data from the database. Ultimately I will want to include the composite instance ID in the SQL but for now I'm just using the code shown here:
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    DBBinXMLMetadataProvider dbrep = BinXMLMetadataProviderFactory.createDBMetadataProvider();
    dbrep.setConnectionPool(ods);
    dbrep.associateDataConnection(conn);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor(dbrep);
    while (rset.next()) {
         Blob blob = rset.getBlob("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

    I found a method using a slight variation of the code I originally posted. Essentially you remove the DBBinXMLMetadataProvider dbrep portion. I believe, with this included, the XML being extracted is validated against the database (which is referenced as a "metadata provider"). Since the SOA schema doesn't seem to contain the information to validate the XML it returns as blank. If you don't include the dbrep portion then the XML is extracted as desired.
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor();
    while (rset.next()) {
         BLOB blob = rset.getBLOB("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

  • How to Cache Data  from database for java mapping ?

    Hi
      I have a scenario where  i have to dynamically query  a huge table in some other database from java mapping code.
    Therefore instead of making a new Database trip everytime is there a mechanism by which i can cache the entire table contents into XI first and then use this cache for looking up data through my java mapping.
    Any other alternative also welcome which would give best performance.
    Please Suggest
    regards
    Nilesh Taunk.

    Hi Nilesh,
    I am not sure if you can actually cache the table in XI. You will have to look up directly from your Database everytime your mapping excecutes.
    To perform DB lookup during mapping very efficiently, I would suggest that you take a look at this blog,
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    Also, instead of doing the DB look up in mapping, you can also use your JDBC adapter as a sender and collect the information you want from your DB,
    If you are using your JDBC as a sender, then your JDBC will poll over your database and select the rows that satisfy your Select Query. Also, there is another field in your JDBC adapter that is very important and that is the Update satatement. Once your JDBC adapter executes your select query and selects rows from the database, you might not need those rows to be selected again. In this csse, you can use the Update statement to update the database.
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    The choice between a JDBC sender adapter , and the DB lookup will have to be on the basis of your requirements.
    Regards,
    Bhavesh

  • Failed to retrieve data from the database (Apache derby). Details: java.lang.reflect.InvacationTargetException

    Post Author: johnnighter
    CA Forum: Data Connectivity and SQL
    Hi,Good Day !I followed crxi_java_bean_data_source.pdf to setup and configure Crystal Report XI (Product Version 11.0.0.1282, CR Developer; Product Type: Full).Below is the sample code.import java.sql.*;public class CRSampleDataSourceBean {    private ResultSet resultSet = null;    private Connection connection = null;     private String connectionURL = "jdbc:derby:MyDatabase";    private String databaseClass = "org.apache.derby.jdbc.EmbeddedDriver";    private String query = "SELECT * FROM CUSTOMER";         public CRSampleDataSourceBean()     {        try         {                        Class.forName(databaseClass);                        connection = DriverManager.getConnection(connectionURL, "", "");        }         catch (ClassNotFoundException ex)         {            System.out.println("Ensure that database driver class is installed.");            ex.printStackTrace();        }         catch (SQLException ex)         {            System.out.println("SQL Exception #" + ex.getErrorCode() + " : " + ex.getLocalizedMessage());            ex.printStackTrace();        }    }            public ResultSet getResultSet() throws SQLException     {                Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);                resultSet = statement.executeQuery(query);        return resultSet;    }}Compile no error. It display at the "Java Beans Connectivity" screen, and able to select from the "Java Bean Classes" combobox.It display at the "Available Data Sources" (left hand side) with database name CRSampleDataSourceBean->getResultSet.  BUT when click the ">" or ">>" button, it display an error message "Failed to retrieve data from the database. Details: java.lang.reflect.InvacationTargetException". Please advice. regards,johnnighter    

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Have you been able to resolve this yet?  I don't have any reference to Oracle error codes but would suspect a quick Google of something like 'Oracle error code 997' should result in good information, since it is an Oracle error...
    Hope this helps.

  • Passing Array of java objects to and from oracle database-Complete Example

    Hi all ,
    I am posting a working example of Passing Array of java objects to and from oracle database . I have struggled a lot to get it working and since finally its working , postinmg it here so that it coudl be helpful to the rest of the folks.
    First thinsg first
    i) Create a Java Value Object which you want to pass .
    create or replace and compile java source named Person as
    import java.sql.*;
    import java.io.*;
    public class Person implements SQLData
    private String sql_type = "PERSON_T";
    public int person_id;
    public String person_name;
    public Person () {}
    public String getSQLTypeName() throws SQLException { return sql_type; }
    public void readSQL(SQLInput stream, String typeName) throws SQLException
    sql_type = typeName;
    person_id = stream.readInt();
    person_name = stream.readString();
    public void writeSQL(SQLOutput stream) throws SQLException
    stream.writeInt (person_id);
    stream.writeString (person_name);
    ii) Once you created a Java class compile this class in sql plus. Just Copy paste and run it in SQL .
    you should see a message called "Java created."
    iii) Now create your object Types
    CREATE TYPE person_t AS OBJECT
    EXTERNAL NAME 'Person' LANGUAGE JAVA
    USING SQLData (
    person_id NUMBER(9) EXTERNAL NAME 'person_id',
    person_name VARCHAR2(30) EXTERNAL NAME 'person_name'
    iv) Now create a table of Objects
    CREATE TYPE person_tab IS TABLE OF person_t;
    v) Now create your procedure . Ensure that you create dummy table called "person_test" for loggiing values.
    create or replace
    procedure give_me_an_array( p_array in person_tab,p_arrayout out person_tab)
    as
    l_person_id Number;
    l_person_name Varchar2(200);
    l_person person_t;
    l_p_arrayout person_tab;
    errm Varchar2(2000);
    begin
         l_p_arrayout := person_tab();
    for i in 1 .. p_array.count
    loop
         l_p_arrayout.extend;
         insert into person_test values(p_array(i).person_id, 'in Record '||p_array(i).person_name);
         l_person_id := p_array(i).person_id;
         l_person_name := p_array(i).person_name;
         l_person := person_t(null,null);
         l_person.person_id := l_person_id + 5;
         l_person.person_name := 'Out Record ' ||l_person_name ;
         l_p_arrayout(i) := l_person;
    end loop;
    p_arrayout := l_p_arrayout;
         l_person_id := p_arrayout.count;
    for i in 1 .. p_arrayout.count
    loop
    insert into person_test values(l_person_id, p_arrayout(i).person_name);
    end loop;
    commit;
    EXCEPTION WHEN OTHERS THEN
         errm := SQLERRM;
         insert into person_test values(-1, errm);
         commit;
    end;
    vi) Now finally create your java class which will invoke the pl/sql procedure and get the updated value array and then display it on your screen>Alternatively you can also check the "person_test" tbale
    import java.util.Date;
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class ArrayDemo
    public static void passArray() throws SQLException
    Connection conn = getConnection();
    ArrayDemo a = new ArrayDemo();
    Person pn1 = new Person();
    pn1.person_id = 1;
    pn1.person_name = "SunilKumar";
    Person pn2 = new Person();
    pn2.person_id = 2;
    pn2.person_name = "Superb";
    Person pn3 = new Person();
    pn3.person_id = 31;
    pn3.person_name = "Outstanding";
    Person[] P_arr = {pn1, pn2, pn3};
    Person[] P_arr_out = new Person[3];
    ArrayDescriptor descriptor =
    ArrayDescriptor.createDescriptor( "PERSON_TAB", conn );
    ARRAY array_to_pass =
    new ARRAY( descriptor, conn, P_arr);
    OracleCallableStatement ps =
    (OracleCallableStatement )conn.prepareCall
    ( "begin give_me_an_array(?,?); end;" );
    ps.setARRAY( 1, array_to_pass );
         ps.registerOutParameter( 2, OracleTypes.ARRAY,"PERSON_TAB" );
         ps.execute();
         oracle.sql.ARRAY returnArray = (oracle.sql.ARRAY)ps.getArray(2);
    Object[] personDetails = (Object[]) returnArray.getArray();
    Person person_record = new Person();
    for (int i = 0; i < personDetails.length; i++) {
              person_record = (Person)personDetails;
              System.out.println( "row " + i + " = '" + person_record.person_name +"'" );
                        public static void main (String args[]){
         try
                             ArrayDemo tfc = new ArrayDemo();
                             tfc.passArray();
         catch(Exception e) {
                        e.printStackTrace();
              public static Connection getConnection() {
         try
                             Class.forName ("oracle.jdbc.OracleDriver");
                             return DriverManager.getConnection("jdbc:oracle:thin:@<<HostNanem>>:1523:VIS",
                             "username", "password");
         catch(Exception SQLe) {
                        System.out.println("IN EXCEPTION BLOCK ");
                        return null;
    and thats it. you are done.
    Hope it atleast helps people to get started. Comments are appreciated. I can be reached at ([email protected]) or [email protected]
    Thanks
    Sunil.s

    Hi Sunil,
    I've a similar situation where I'm trying to insert Java objects in db using bulk insert. My issue is with performance for which I've created a new thread.
    http://forum.java.sun.com/thread.jspa?threadID=5270260&tstart=30
    I ran into your code and looked into it. You've used the Person object array and directly passing it to the oracle.sql.ARRAY constructor. Just curios if this works, cos my understanding is that you need to create a oracle.sql.STRUCT out of ur java object collection and pass it to the ARRAY constructor. I tried ur way but got this runtime exception.
    java.sql.SQLException: Fail to convert to internal representation: JavaBulkInsertNew$Option@10bbf9e
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:239)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatumArray(OracleTypeADT.java:274)
                        at oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(OracleTypeUPT.java:115)
                        at oracle.sql.ArrayDescriptor.toOracleArray(ArrayDescriptor.java:1314)
                        at oracle.sql.ARRAY.<init>(ARRAY.java:152)
                        at JavaBulkInsertNew.main(JavaBulkInsertNew.java:76)
    Here's a code snippet I used :
    Object optionVal[] =   {optionArr[0]};   // optionArr[0] is an Option object which has three properties
    oracle.sql.ArrayDescriptor empArrayDescriptor = oracle.sql.ArrayDescriptor.createDescriptor("TT_EMP_TEST",conn);
    ARRAY empArray = new ARRAY(empArrayDescriptor,conn,optionVal);If you visit my thread, u'll see that I'm using STRUCT and then pass it to the ARRAY constructor, which works well, except for the performance issue.
    I'll appreciate if you can provide some information.
    Regards,
    Shamik

  • Generating next number from the SQL database using java

    Hi friends, I have a problem and need your help. I am working on a project about submitting claims form through the adobe PDF file and SQL database. I have problem working on a web service (written in java) that will generate the next Invoice Number from the SQL Database table. The field type for the column is text(var char). *Example: I first need to get into the table and search for the last Invoice number in the table and if the last invoice number in the table from the database is 3, i would want to generate the next number which is 4 and filled it up in the PDF file through web service that i am implementing. Can you all provide me some guidelines on how to implement this method in my web service?
    Thanks a lot. I need it by today. Hope someone can reply this as soon as possible.
    Lim89
    Edited by: LIM89 on Apr 2, 2008 7:10 PM

    far simpler to use a sequence generator, which most databases support.
    Suggested method to get the max value in the column is NOT secure, unless you lock the entire table for update before you do so, which is a severe performance penalty.

  • Error export from my database sql 2005 with Windows 2003 abap+java

    Hi all
    I'm trying to create an Export from my database sql 2005 with Windows 2003, but SAPINST starts with an error. ABAP+JAVA stack
    While running the export preparation, I am getting the following error;
    INFO 2010-09-08 12:12:43
    Output of C:\j2sdk1.4.2_13-x64\bin\java.exe -classpath D:\usr\sap\BID\SYS\global\sltools\sharedlib\launcher.jar -showversion -Xmx256m com.sap.engine.offline.OfflineToolStart com.sap.sl.ut.manager.UtlMain
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jce.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jsse.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_smime.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_ssl.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/w3c_http.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.infoprovider_lib.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.manager.offline.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/antlr.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/exception.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/jddi.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/logging.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/offlineconfiguration.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/opensqlsta.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/tc_sec_secstorefs.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comtcsdtcvlimpl.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SDMutil.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SLUtil.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\base.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\util.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\sqlserver.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\spy.jar -export -type=keydb "-expfile=C:/Program Files/sapinst_instdir/NW04S/LM/COPY/MSS/EXP/CENTRAL/AS/PREEXP/usages_data.xml" -log=UTL_load_usages.log -sid=BID -dsn=jdbc/pool/BID -ssprops=D:/usr/sap/BID/SYS/global/security/data/SecStore.properties -ssk=D:/usr/sap/BID/SYS/global/security/data/SecStore.key is written to the logfile C:/Program Files/sapinst_instdir/NW04S/LM/COPY/MSS/EXP/CENTRAL/AS/PREEXP/UTL.java.log.
    WARNING 2010-09-08 12:12:46
    Execution of the command "C:\j2sdk1.4.2_13-x64\bin\java.exe -classpath D:\usr\sap\BID\SYS\global\sltools\sharedlib\launcher.jar -showversion -Xmx256m com.sap.engine.offline.OfflineToolStart com.sap.sl.ut.manager.UtlMain
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jce.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jsse.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_smime.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_ssl.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/w3c_http.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.infoprovider_lib.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.manager.offline.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/antlr.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/exception.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/jddi.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/logging.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/offlineconfiguration.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/opensqlsta.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/tc_sec_secstorefs.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comtcsdtcvlimpl.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SDMutil.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SLUtil.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\base.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\util.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\sqlserver.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\spy.jar -export -type=keydb "-expfile=C:/Program Files/sapinst_instdir/NW04S/LM/COPY/MSS/EXP/CENTRAL/AS/PREEXP/usages_data.xml" -log=UTL_load_usages.log -sid=BID -dsn=jdbc/pool/BID -ssprops=D:/usr/sap/BID/SYS/global/security/data/SecStore.properties -ssk=D:/usr/sap/BID/SYS/global/security/data/SecStore.key" finished with return code 64. Output:
    java version "1.4.2_13"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_13-b06, mixed mode)
    ERROR 2010-09-08 12:12:46
    CJS-30071  Execution of UTL tool 'C:\j2sdk1.4.2_13-x64\bin\java.exe -classpath D:\usr\sap\BID\SYS\global\sltools\sharedlib\launcher.jar -showversion -Xmx256m com.sap.engine.offline.OfflineToolStart com.sap.sl.ut.manager.UtlMain
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jce.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_jsse.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_smime.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/iaik_ssl.jar;
    JRBIWD/sapmnt/BID/SYS/global/security/lib/tools/w3c_http.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.infoprovider_lib.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comsl.ut.manager.offline.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/antlr.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/exception.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/jddi.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/logging.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/offlineconfiguration.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/opensqlsta.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/tc_sec_secstorefs.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/sap.comtcsdtcvlimpl.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SDMutil.jar;D:/usr/sap/BID/SYS/global/sltools/sharedlib/SLUtil.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\base.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\util.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\sqlserver.jar;D:\usr\sap\BID\DVEBMGS01\exe\mssjdbc\spy.jar -export -type=keydb "-expfile=C:/Program Files/sapinst_instdir/NW04S/LM/COPY/MSS/EXP/CENTRAL/AS/PREEXP/usages_data.xml" -log=UTL_load_usages.log -sid=BID -dsn=jdbc/pool/BID -ssprops=D:/usr/sap/BID/SYS/global/security/data/SecStore.properties -ssk=D:/usr/sap/BID/SYS/global/security/data/SecStore.key' aborts due to database connection error with return code 64.<br>DIAGNOSIS: The connection parameters are wrong or the database server is shutdown.<br> SOLUTION: Check 'UTL_load_usages.log' and 'C:/Program Files/sapinst_instdir/NW04S/LM/COPY/MSS/EXP/CENTRAL/AS/PREEXP/UTL.java.log' for more information.
    ERROR 2010-09-08 12:12:46
    FCO-00011  The step getUsageTypes with step key |NW_Prepare_Export|ind|ind|ind|ind|0|0|NW_Java_Prepare_Export_Dialog|ind|ind|ind|ind|5|0|getUsageTypes was executed with status ERROR .
    Could anyone please help me out on this, if possible?
    Thanks
    JM

    Hi,
    please ensure that you use a SAP supported JDK as below:
    716604    for the Sun JDK (Windows, Linux, Solaris)
    709140    Recommended JDK and VM Settings for the WebAS630/640/7.0
    And the re try the export pls.
    Regards,
    Snow

  • Handling in java special characters read from the database

    Hello,
    I have a java application which processes data from the database. During processing I have to handle some special national characters which are specified with integer codes. The codes are defined in UTF-8 and the list of these characters and their codes is constant.
    How to handle them in java where char primitive type denotes characters in UTL-16, not UTF-8. Should I use class Charset and decoder like below?
    Charset charset = Charset.forName("UTF-8");
    CharsetDecoder decoder = charset.newDecoder();
    The problem which I see here is that class CharsetDecoder provides no method which would take integer code of the character in UTF-8 and return char value (in UTF-16).
    The only way I see is to provide ByteBuffer, but then I have to encode the codes of these characters in UTF-8 somehow (how?), as they have two bytes codes like 50048.
    Best wishes,
    Tomasz Michniewski
    Edited by: Tomasz Michniewski on 2009-09-08 04:19

    Please verify the followings:
    Make sure that from the SharePoint front end and application servers that you can ping your SQL server.
    Make sure that your Farm account has permission to the configuration database.
    Lastly verify that your database didn't for some reasons go into recovery mode.
    once everything is fine and you are still having issues, restart the SQL host service on the SQL server.
    Once the service is restarted you will need to reboot Central Admin and then your front end servers.
    In addition, as you built your farm inside the firewall, please disable the firwall, or create rules for SQL Server service in the firwall on SQL server.
    More information about creating rules in firewall, please refer to the following posts: http://social.technet.microsoft.com/Forums/en-US/c5d4d0d0-9a3b-4431-8150-17ccfbc6fb82/can-not-create-data-source-to-an-sql-server http://www.mssqltips.com/sqlservertip/1929/configure-windows-firewall-to-work-with-sql-server/
    Here is a similar post for you to take a look at: http://social.technet.microsoft.com/Forums/en-US/ea54e26c-1728-48d4-b2c5-2a3376a1082c/this-operation-can-be-performed-only-on-a-computer-that-is-joined-to-a-server-farm-by-users-who-have?forum=sharepointgeneral 
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • What is te best way to copy a table from a database to another?

    Hello friends:
    I have two databases: an Access database and an Oracle database. I must copy the data from al tables from the Access database to the oracle database. The tables in the both databases are equal (number of columns, type, etc).
    I read an resultset from acces (select * from table1) and I insert every row in the Oracle database with an while loop (while (r.next)...). It works fine when there are a few rows, but I have a table with over 200000 rows, and when I'm copying the row number 30.000, the system goes very slow...
    How can I copy tables from a database to another more quickly?
    Thanks!

    CASE #1
    The most efficient method would be to copy all the rows from Microsoft Access and write them to a text file using Access's native interface (not JDBC), then use Oracle's SQL Loader utility (not JDBC) to insert the data.
    You can insert 200,000 rows of 80 bytes each in 30 seconds or less even on a modest Oracle system using SQL Loader. The extract from Access is very dependent on the size of the CPU and the available memory.
    Hint 1: Avoid explicit or implict network traffic.
    Hint 2: Extract and load from local drives rather than networked or shared drives on other services
    Please note that this is done for efficiency of load, but has issues related to error checking, and operational scripting.
    Anything else you do or use will be slower than the method (above).
    CASE #2
    If you want to integrate this into a single JDBC program which will provide better operational management of the process, then you can simply connect to both databases in your Java program, then read the rows one at a time from Access, insert them using the Batch mechanism of JDBC to Oracle. You will also want to set the FetchSize in Oracle to a larger value then the default (i.e set it to 100 vs 10).
    Hint #3 You may want to look into alternative JDBC drivers for accessing MS Access, rather than the JDBC-ODBC bridge which is not optimized for MS Access. You may also want to consider using the OCI8 driver from Oracle rather than the thin driver. Both provide Type 4 functionality but I have heard (not experienced) that the OCI8 driver is better for managing batch style of processing like yours
    Good luck!
    Joel

  • Creation of a complex object from several databases?

    Hello!
    We need to have an ability to change certain property of the record, stored in the database, without reading the full record from the database, changing the property and updating the database with this new record. As far as I know there's no way for partial access to the record data (LOB access section from FAQ), so I am thinking in a bit different way - what if we keep the information of certain record in the different databases, and when we need to update some property of the record knowing the key - we will just update the appropriate database? This looks something similar to secondary databases when the secondary key is an alias for primary record - but in this case primary key would be referenced from several databases and it would be possible to specify which data from which database to obtain using the key?
    I think it could be created based on several custom object bindings now, or something like this.

    Eugene,
    If you update properties in different combinations and there is no logical way to group them to reduce the size of the operations, then it's not worth splitting up the record. That's up to you to determine.
    JE SecondaryDatabase and SecondaryCursor methods have overloaded signatures for returning the secondary key, primary key, and primary data, all in one method call. So I think you're confused about the method signatures -- the data parameter is always used to return the primary data.
    Note that internally whenever you read via a secondary, JE does two reads: one to read the secondary index and get the primary key, and another to read the primary index.
    There is no trick to get around doing multiple reads when you have relationships between different databases. Each primary and secondary database is an index or map (conceptually the same as a java.util.Map) that can be accessed by key or by iterating. Whatever you do must be built on top of map operations.
    The best way to think about data modeling is to think about maps and their keys, and the best way to think about how to do a query is to break it down into map operations. I say this because most Java programmers are familiar with maps and map operations, because java.util.Map is commonly used.
    The DPL (persist package) makes data modeling simpler to code and understand, because annotations can be used describe relationships between indexes. When using the DPL it is very clear that for every secondary index there is a secondary key, and that entity relationships are formed via secondary keys. However, the DPL model is still based on maps and map operations.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get the value from a database without submitting a jsp page

    I have a jsp which has a text box depending on the value entered I want to get the value from a database for other two fields with out submitting jsp page. I am using struts.
    Thanks For any assistance provided.

    Alright,here is an example for you for the first case.
    Present.jsp:
    ============
    <html:html>
    <head>
    <title><html:message key="page.title"/></title>
    </head>
    <body>
    <html:form action="ChangeEvent.do">
    <html:hidden property="method"/>
    <!-- Submitting the Form onKeyUp of EmpId field and trying to save the
         state of the Form in the scope of session -->
    Emp Id:<html:text property="empId" size="5"  onkeyup="if(true){this.form.elements[0].value='populateDetails';this.form.submit();}"/>
    Emp Name:<html:text property="empName" size="10" />
    Email Address:<html:text property="email" size="10" />
    <html:submit>Submit</html:submit>
    </html:form>
    </body>
    </html:html>struts-config.xml:
    ==================
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- Form bean which stores the properties of all the Form elements -->
    <form-beans>
    <form-bean name="employeeFormBean" type="org.apache.struts.action.DynaActionForm">
       <form-property name="empId" type="java.lang.String"/>
       <form-property name="empName" type="java.lang.String"/>
       <form-property name="email" type="java.lang.String" />   
    </form-bean>
    </form-bean>
    <action-mappings>
    <action path="/ChangeEvent" type="Test.GetChangeAction" name="employeeFormBean" scope="request" parameter="method"> 
    <!-- On successful call of DB the Page has to be forwarded to the same page again by
          uploading updated form bean values. -->
    <forward name="success" path="/Present.jsp"></forward>
    <forward name="failed" path="/error.jsp"></forward>
    </action>
    </action-mappings>
    </struts-config>GetChangeAction.java:
    =====================
    public class GetChangeAction extends DispatchAction{
      public ActionForward populateDetails(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            DynaActionForm dForm = (DynaActionForm)form;
            String empId = dForm.get("empId");     
            // calling Model / Db and then getting back Employee Details
            EmployeeBean eb = ModelUtils.getDetails(empId);
            // Updating form bean by updating values from the Model 
            dForm.set("empName".eb.getEmpName()); 
            dForm.set("email".eb.getEmail());
            return mapping.findForward("success");
    }well to me this should work regardless to any browser but we need to make sure we put in our logic properly.

  • Sending an email from my database

    Hi!
    I wanna send an email from within a procedure from my database, Im thinking of using the utl_smtp package, I know I need acces from my database server to the smtp server, that can be done... when u use the utl_smtp package u need to specify the smtp host, the email address of the sender, the email address of the receptor, and some other stuff, what I wonder is: Where do u specify the password of the email address of the sender?, I mean, it doesnt make sense that u use an email address to send an email and u dont specify the password of that account
    In all the samples Ive seen all over internet I havent found something that tells me something about it...
    Any Help???

    A lot of smtp servers do not require a username/password when sending mail, only when receiving mail.
    If you need verification, you can do it with utl_smtp:
    utl_smtp.command( conn, 'AUTH LOGIN'); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cuser ))) ); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cpassword ))) ); 

Maybe you are looking for

  • Indesign CC: the shortcut «Align left --- Default: Shift+Cmd+L» seems not working...

    Under any keyboard combination: default, proper, PM, Quark The Indesign label in the menu (above, left) is shadowed when the shortcut is typed. But the rest of them are oK Shift+Cmd+R Shift+Cmd+C Shift+Cmd+J Shift+Cmd+F Could be fixed in some way? Ju

  • Richtext color change in as3

    Hi, i want to change the color of an Richtext in as3 and not in mxml. Something like this : RichtextID.color = 0x000000 ; Greetings Zombiecook

  • Preferences advanced network connection configure button missing

    Checking preferences > advanced > network > connection > configure how Firefox connects to the internet, found that the "settings" button did not appear. Also, the "encryption" tab on the far right was gone. Most recent changes were to install addons

  • Migration/Development Strategy

    Hi, Can any one provide me the information about: - Strategy for migrating Intranet/Exisitng web site to Oracle Portal. - Methodology for new Portal devlopment. Many Thanks, Divyesh Desai

  • Accessing data from GDC

    Hi All,      I need to access data from global data context from a badi implementation. Generally to access GDC, we use the below code from ic webclient, but it neeeds a instance of controller. lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_c