Problems while storing Timestamp into Max db

Hai All,
     I am getting problem while inserting Timestamp into Maxdb
Here iam giving Timestamp as input to the entityBean , and in database also i was taken that field as timestamp.
the following is the code snippert,
Date dte=new Date();
          Calendar c = Calendar.getInstance();
          java.sql.Timestamp t=new Timestamp(c.getTimeInMillis());
          try {
               objTestingEntityLocalHome.create(strArg1,intarg2,dblDouble,t);
          } catch (CreateException e) {
               return "Ex" +e;
          }catch (Exception e) {
                    return "Ex: "+e;
whenever I run this program it is insering date correctly, but time stamp is  inserting incurrectly,it is not inserting current time stamp of the server
anybody please help me inthis regard
thanks
somu

Hi,
try this:
GregorianCalendar c = new GregorianCalendar();
java.sql.Timestamp t=new Timestamp(c.getTimeInMillis());
Good luck,
Roelof

Similar Messages

  • Facing  problem while loading data into XI

    Hi All,
    I am facing a peculiar problem while loading data into XI when we load small amount of data say 5-10 records these records gets processed, but when we try to load a bit higher volume say 100-500 which comes out to be around 7 record s per second then the record processing gets stalled. That is it gives a message that "recorded for outbound processing".
    So can any body throw some light on it and can tell us why we rare facing such problem and how can we resolve that problem.
    Thanks in Advance.
    Regards
    rahul

    Hi rahul,
    Deregistering and Registering the Queue is a temporary solution.
    The better way to this would be to Tune your Xi system as already mentioned by Vijaya as mentioned in the guide ,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/70ada5ef-0201-0010-1f8b-c935e444b0ad
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7fdca26e-0601-0010-369d-b3fc87d3a2d9
    Regards,
    Bhavesh

  • JNDI : connection problem while storing data more than one records

    I am persisting data into the MSSQL Server 2005 database using the JNDI lookup. I can insert the single record at a time, but when I ran the test program for 10 or 20 records i am getting the following exception on Jboss
    Configuration details : JBoss, Spring, MSSQL server 2005, Jdk 5
    JNDI mapping from JBOSS
    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
    <local-tx-datasource>
    <jndi-name>jdbc/myjndi</jndi-name>
    <!-- allows DS to be accessed remotely -->
    <use-java-context>false</use-java-context>
         <connection-url>jdbc:inetdae7:localhost:1434?database=myDB&secureLevel=0</connection-url>
         <driver-class>com.inet.tds.TdsDriver</driver-class>
         <user-name>sa</user-name>
         <password>admin123</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>50</max-pool-size>
    <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    </local-tx-datasource>
    </datasources>
    Exception :
    14:07:06,812 INFO [myMDB] Exception while Storing Event in Database : Could not get JDBC Connection; nested exception is org.jboss.util.Neste
    dSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset); - neste
    d throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.S
    ocketException: Connection reset))
    14:07:06,812 INFO [STDOUT] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava
    .net.SocketException: Connection reset); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (co
    m.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset))
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
    14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
    14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:177)
    14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:356)
    14:07:06,812 INFO [STDOUT] at com.org.project.gen.MyDAOImpl.insert(MyDAOImpl.java:25)
    14:07:06,812 INFO [STDOUT] at com.org.project.geo.MyTabletDAO.addEvent(MyTabletDAO.java:137)
    14:07:06,812 INFO [STDOUT] at com.org.project.mdb.myMDB.onMessage(myMDB.java:72)
    14:07:06,812 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
    14:07:06,812 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    14:07:06,812 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
    14:07:06,812 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
    14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._run(TibjmsSession.java:3054)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession.run(TibjmsSession.java:4204)
    14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
    14:07:06,812 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
    14:07:06,812 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
    14:07:06,812 INFO [STDOUT] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.
    SocketExceptionjava.net.SocketException: Connection reset)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
    java:161)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnection
    Pool.java:508)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManage
    r2.java:874)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
    14:07:06,812 INFO [STDOUT] ... 33 more
    14:07:06,812 INFO [STDOUT] Caused by: com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset
    14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createSQLException(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.<init>(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.q.<init>(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createConnection(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsDriver.connect(Unknown Source)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
    java:151)
    14:07:06,812 INFO [STDOUT] ... 41 more

    Hi Subin,
    You can try couple of things.
    If your data is less than 32767, you can pass it to stored procedure and change it to clob type like
    PROCEDURE CLOBQUERY
         Param     IN     CLOB,
    and you can call Procedure
    EXECUTE CLOBQUERY '[Param.1]'
    If your data is around than 1000000(32767*32), you can break the data in length of 32767 and pass it to param 1 to 32 like
    EXECUTE CLOBQUERY '[Param.1][Param.2][Param.3]..[Param.32]'
    Finally you can try to update jdbc drive.
    check the link Link: [JDBC Limitation|http://confluence.atlassian.com/display/JIRA/UsingOracle10gdriverstosolvethe4000character+limitation]

  • Time Stamp problem while writing data into the excel file

    Hii, All
                  I am taking the data from the DAQ card of the TOPSCCC with the 8 ms of scanrate for each channel and there are total 16 no of Analog channels in the Card, now i am acquiring the data from the card, time stamping it and writing it into the excel file, which is tab delimited, now the problem is, the data which are in the excel file have the same timestamp for 4 to 5 continuous records, instead we want each data with the different and continuous time stamp with same difference of time stamp between two records, mean if it is difference of 8 ms then it should be the 8 ms for all, but here it is taking the differnce of 16 ms for two samples and giving same time stamp for four to five records and that shouldn't happen, here i am attaching my vi, drivers for the cards and Excel file with the data, can you please give me any suggestion how to do it?
           Please help me i require this suggestion as early as possible, i am requiring it urgently.
    Thanks in Advance,
    Nishant
    Attachments:
    2026vi.llb ‏319 KB
    2026_ScanMultAD_Demo_time.vi ‏80 KB
    Data.xls ‏357 KB

    Hello Nishant,
    that's what I meant:
    Message Edited by GerdW on 05-16-2006 10:32 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    timestamp-array.png ‏2 KB

  • Problems while inserting data into Oracle10g RDF store

    hi
    I ran into this error again after it was fixed last time. Even this time it was the same error
    ID: 9777 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    I was been told that this problem will be fixed in the new version of Oracle RDF store , just wondering whether the new version has been released. Currently I am using Oracle10g .
    triples causing errors :
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Receptor_Down_Regulation> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#dDEFINITION> "<def-source>NCI</def-source><def-definition>Due to internalization of ligand-receptor complexes, increased receptor turnover, or decreased receptor expression following exposure to a ligand or agent, Receptor Down Regulation involves a decrease in the number of ligand-specific cellular proteins that bind to, and mediate, the effects of a regulatory molecule.</def-definition>" .
    ID: 7528 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#EFP_Cell_Cycle_Pathway> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>Estrogen-responsive protein Efp controls cell cycle and breast tumors growth</term-name><term-group>PT</term-group><term-source>BIOCARTA</term-source>" .
    ID: 7525 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    triples that did not throw any error while loading
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>hypercalcemia</term-name><term-group>PT</term-group><term-source>NCI-GLOSS</term-source><source-code>CDR0000045363</source-code>" .
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>Hypercalcemia</term-name><term-group>PT</term-group><term-source>NCI</term-source>" .
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
    thanks chandra

    "RDF Error occurred" is a generic error message and might be from a number of causes (there are more meaningful error messages in the next patch release, 10.2.0.3). The likely cause is an error due to leading blanks in an object literal string or a null object literal string. For example " Oracle" and "" cause this error during load. This has been fixed in 10.2.0.3. A special patch including this and other fixes for RDF is being made available also. I will post details here as soon as it is ready.
    For now, the best option might be to process your data and remove the leading blanks and re-write the null strings as "NULL" and re-try the load. The special RDF patch should be ready in a couple of weeks.

  • Problems while storing a BLOB

    Hi
    I need to store a blob in a MS Access db while receiving a mail, but I can't arrive!
    This is my code, could anyone help me?
    Many thanks in advance.
                             Blob blob = null;
                             PreparedStatement pst2 = con.prepareStatement("INSERT INTO TMail (Allegato, NomeAllegato) VALUES (?, ?)");
                             pst2.setBlob(1, blob);
                             pst2.setString(2, "prova");
                             pst2.executeUpdate();
                             con.commit();
                             PreparedStatement dbQuery = con.prepareStatement("SELECT Allegato " +
                                       "FROM TMail WHERE NomeAllegato = " + "'prova'"); //primaryKey);
                   ResultSet rs = dbQuery.executeQuery();
                   rs.next();
                   blob = rs.getBlob("Allegato");
                   OutputStream outstream = blob.setBinaryStream(1L);
                    long size = blob.length(); // sarebbe getBufferSize()
                    byte[] buffer1 = new byte[(int)size]; // occhio al cast!
                    int length = -1;
                    while((length = in.read(buffer1)) != -1)
                             outstream.write(buffer1, 0, length);
                    outstream.close();
                    PreparedStatement pst1 = con.prepareStatement("INSERT INTO TMail (Allegato) VALUES (?)");
                     pst1.setBlob(1, blob);
                     pst1.executeUpdate();
                     con.commit();
                     ... then I'm uploading the others fileds into a db.Maybe is possible to store the blob withut to reserve an empty space while uploading the others fields?

    This post will not solve your problem.
    However, MS Access IS NOT a database, it is an
    application that mimics relational databasebehavior,
    but a database it is not. There are formal definitions of databases and at
    least to some extent MS Access meets the definition.I believe at to be a true database, you must provide for multiple users to access the db via network protocols, independent of the OS. Access doesnt do that. JMO.
    >
    Secondly, whenever I tried
    to use MS Access and Java via the JDBC-ODBC Bridge
    during my college career, I had nothing butproblems.
    And which of the following did you have problems
    with?
    1. The ODBC driver itself?
    2. Understanding what the bridge, the MS Access ODBC
    driver and what MS Access allows?
    3. Something else that has nothing to with MS Access
    but instead might apply to any database?
    Most of our problems were related to the JDBC-ODBC bridge and the underlying system DSN. We also had numerous problems after executing even the simplest of select querries, we would end up with empty result sets. Once we switched to MySQL and the Connector/J, the problems went away.
    Another problem was the schools policy of not allowing us to save data on any computer. We could install software and save files, but as soon as the 'puter was turned off, the HDD was restored to the original image 'approved' by the school. For our senior capstone courses we were susposed to design, develop, and deploy a system to solve some problem. We were free to choose the topic. Given the computer policy it was a waste of time unless you used Microsoft Access. We couldnt even save DSN's on the schools puters nor change the time of the system.
    Further, I did some research on the web and the
    prevailing view I discovered was not to use MS
    Access.I believe you will find many more opinions that you
    shouldn't be using java but instead should be using
    C# or C++.
    So what language do you program in?Java 2 SE
    >
    hope you find a solution to your problem. In
    addition, a small piece of advice for you in the
    future would be to use MySQL (you can downloadfree)
    and or Oracle 10g (also a free download). Presumably you are addressing the needs of a student,
    because a business can not use Oracle for free. Even
    a minimal install is quite expensive.Yes, I assumed this was a student project as the OP mentioned something about a test/project.
    I am also guessing the OP's school is heavily vested with Microsoft's products such as the Office suite, Visual Studio, and even the class registration web sit did not function correctly without IE5 or better. I normally use Firefox and I always had to register using IE.
    >
    And I haven't checked recently but at one time that
    was potentially true for MySQL as well.I believe MySQL uses a dual licensing model. If you develop a GPL open source application, its free. If you release some comercial product that uses MySQL, you must buy a license.
    Most of the time I am using the DB's at home for educational / proof of concept type stuff. For school projects. I do not believe there is any problem. However, if the project is soo good that it can be comercially used, then by all means buy a license.
    >
    Both also require installs (of the database itself)
    into the production environment. MS Access on a
    windows box does not require that.
    I dont understand what you are saying. MySQL runs fine on my laptop. Also whats to prevent a company from deploying to a test / development environment prior to roll out? Other than money that is.
    Those are
    both true databases. Please before anyone screams
    at me about database X or Y... I know there are a
    myriad of others out there but Oracle and MySQLare
    the 2 biggest dogs out there competing with
    Microsoft.
    >
    The competition with those would be MS SQL Server and
    not MS Access. And MS SQL Server also is "free" at
    least in the same way that Oracle is.Thats cool. The last time I had looked all the SQL server downloads were time limited to like 90 days. But that was several years ago.

  • Authority experts:: Problems with storing workbooks into the role menue

    Hello,
    during upgrade from BW 3.5 to BW 7.0 we got the problem, that workbooks cannot be stored into the role menue.
    Trace ST01 and RSECADMIN hasn't send any authority warnings.
    The workbooks are stored in the role menu (PCFG). We cann't find them by searching with the
    query designer.
    This are the entries we made in the roles:
    S_USER_AGR:
    ACTVT = *,
    ACT_GROUP = Menu-Role
    S_USER_TCD:
    TCD = RRMX
    (We took notice of the new analysis authoritation )
    Thanks in advance.
    Greetings
    Peggy Nosek

    goto the particular role in PFCG and check whether you are able to see the workbook. You can see the workbook in query designer. Open BEx analyzer and use the open workbook option to search for workbooks. The search is case sensitive. If you do not see any roles assigned through BEx anayzser, run a trace in RSECADMIN with your user id.

  • Problem while deploying ear into integration server of JCAPS 5.1.1

    hi all,
    when i'm trying to deployinag an ear file into JCAPS 5.1.1 integration server i'm getting the follwing error and i am not able to deploy the project.
    javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:872)
    org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:114)
    org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:792)
    java.security.AccessController.doPrivileged(Native Method)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:790)
    SeeBeyondISDeployer.pages.ManageApplications_jsp._jspService(ManageApplications_jsp.java:1155)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:318)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
    java.security.AccessController.doPrivileged(Native Method)
    edu.yale.its.tp.cas.client.filter.CASFilter.doFilter(CASFilter.java:635)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:318)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:261)
    root cause
    can any body help me out to resolve this problem.
    Thanks In Advance

    First check is Java stack is running ?
    make sure J2EE_ADMIN user not locked.
    Ans please check password in secure area. check password in secure store should be correct.
    may be you can try with restart of SAP and DB.
    All the best
    regards
    nag

  • Problem while storing items from trailing list  to database

    hi all,
    can anyone help me out. i have scenario where i have to store items from trailing list into database. suppose if there are 3 items in the list, 3 rows should be inserted into database with all the remaining fields same like
    A ,1 , c
    A, 2, c
    A , 3, c where 1,2,3 are items from trailing list. Am iterating the loop.
    What am doing is before saving am checking for duplicates i.e are there any records with the same combination. If yes am doing nothing else am committing the changes..
    As am not doing anything if any duplicte record is present, the changes made to the fields persists and once if any commit happens all the values are getting saved. which is voilating my condition..
    Thanks

    Hello,
    Direct path load, can only be used with SQL*Loader and Database have the same version.
    Care to tell the database version and sql*loader version you are using.
    -Sri

  • Problem with storing key into database and decrypting the password.....

    Hi every one, i have prob with this code
    import java.security.NoSuchAlgorithmException;
    import java.sql.Blob;
    import java.sql.ResultSet;
    import javax.crypto.KeyGenerator;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.SecretKey;
    import java.security.Key;
    import java.io.*;
    import java.security.InvalidKeyException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import javax.crypto.BadPaddingException;
    import javax.crypto.Cipher;
    import javax.crypto.IllegalBlockSizeException;
    public class SecurityUtil {
    public static final String ALGORITHM ="DES";
    public static Cipher cipher;
    SecurityUtil() throws NoSuchAlgorithmException, NoSuchPaddingException {
    cipher = Cipher.getInstance(ALGORITHM);}
    public static void serializeKey(Key key, File file) {
    //serializing
    try {     FileOutputStream fos = new FileOutputStream(file);
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(key);
    oos.flush();
    oos.close(); } catch (Exception e) { System.out.println("Exception during serialization: " + e);
    System.exit(0); } }
    public static SecretKey deserializeKey(File file) {   //deserializing
    SecretKey key1 = null;
    try {  FileInputStream fis = new FileInputStream(file);
    ObjectInputStream ois = new ObjectInputStream(fis);
    key1 = (SecretKey) ois.readObject();
    ois.close();
    System.out.println("object2: " + key1); } catch (Exception e) {
    System.out.println("Exception during deserialization: " + e);
    System.exit(0);}
    return key1;
    public static byte[] encrypt(String input, SecretKey key) throws InvalidKeyException, BadPaddingException,
    IllegalBlockSizeException {
    cipher.init(Cipher.ENCRYPT_MODE, key);
    byte[] inputBytes = input.getBytes();
    return cipher.doFinal(inputBytes);
    public static String decrypt(byte[] encryptionBytes, SecretKey key) throws InvalidKeyException,
    BadPaddingException, IllegalBlockSizeException {
    cipher.init(Cipher.DECRYPT_MODE, key);
    byte[] recoveredBytes = cipher.doFinal(encryptionBytes);
    String recovered = new String(recoveredBytes);
    return recovered;
    public static void main(String[] args) throws Exception {
    SecurityUtil su = new SecurityUtil();
    // SecurityUtil.testUsingSerialization();
    SecurityUtil.testWithDatabase();
    public static void testUsingSerialization() throws Exception {
    KeyGenerator kg = KeyGenerator.getInstance("DES");
    kg.init(56); // 56 is the keysize. Fixed for DES
    SecretKey key = kg.generateKey();
    File file1 = new File("root:/testKey.key");
    serializeKey(key, file1);
    SecretKey deserializedKey = deserializeKey(file1);
    byte[] encryptionBytes = encrypt("input", key);
    System.out.println("Recovered: " + decrypt(encryptionBytes, deserializedKey));
    public static void testWithDatabase() throws Exception {
    KeyGenerator kg = KeyGenerator.getInstance("DES");
    kg.init(56); // 56 is the keysize. Fixed for DES
    SecretKey key = kg.generateKey();
    boolean insertResult = insert("prasunay","prasunay",key);
    System.out.println("<<======= insert result: " + insertResult);
    boolean validateAuthenticationDetails = validateAuthenticationDetails("prasunay","prasunay");
    System.out.println("<<======= right values:" + validateAuthenticationDetails);
    boolean validateAuthenticationDetails1 = validateAuthenticationDetails("prasunay","prasun");
    System.out.println("<<======= WRONG values:" + validateAuthenticationDetails1);
    System.out.print("done!"); }
    public static boolean insert(String username,String password,SecretKey key) throws Exception {
    // mysql> CREATE TABLE myusers (user_name VARCHAR(20), pass_word VARCHAR(20), my_key BLOB);
    // Query OK, 0 rows affected (0.03 sec)
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/users?user=root&password=");
    PreparedStatement ps = con.prepareStatement("INSERT INTO myusers VALUES (?, ?, ?)");
    ps.setString(1,username);
    byte[] encryptionBytes = encrypt(password, key);
    ps.setString(2, new String(encryptionBytes));
    ByteArrayInputStream ois = getStreamFromKey(key);
    byte[] keyBytes = getBytesFromKey(key);
    System.out.println("Key Length" + keyBytes.length);
    ps.setBinaryStream(3, ois, keyBytes.length);
    int result = ps.executeUpdate();
    System.out.println(result);
    ps.close();
    con.close();
    if (result > 0) {
    return true;
    } else {
    return false; } }

    code continuation.......
    public static boolean validateAuthenticationDetails(String username, String password) throws Exception {
    boolean result = false;
    // mysql> CREATE TABLE myusers (user_name VARCHAR(20), pass_word VARCHAR(20), my_key BLOB);
    // Query OK, 0 rows affected (0.03 sec)
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/users?user=root&password=");
    PreparedStatement ps = con.prepareStatement("select my_key,pass_word from myusers where user_name = ?");
    ps.setString(1, username);
    ResultSet resultSet = ps.executeQuery();
    if (resultSet.next()) {
    String passwordFromDB = resultSet.getString("pass_word");
    Blob keyBlob = resultSet.getBlob("my_key");
    System.out.println(keyBlob);
    System.out.println("key" + resultSet.getBinaryStream("my_key").read());
    InputStream keyInputBinaryStream = keyBlob.getBinaryStream();
    System.out.println("keyInputBinaryStream: " + keyInputBinaryStream);
    System.out.println("keyInputBinaryStream: " + keyInputBinaryStream.available());
    ObjectInputStream ois = new ObjectInputStream(keyInputBinaryStream);
    SecretKey key = (SecretKey) ois.readObject();
    System.out.println(key);
    String decryptedPwd = decrypt(passwordFromDB.getBytes(), key);
    System.out.println("Decrypted pwd : " + decryptedPwd);
    System.out.println("pwd sent for authorization : " + password);
    if (password.equals(decryptedPwd)) {
    result = true;
    } else {result = false;   }
    } else {
    System.out.println("Invalid user!!"); }
    ps.close();
    con.close();
    return result; }
    public static ByteArrayInputStream getStreamFromKey(SecretKey key) throws Exception {
    ByteArrayOutputStream o = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(o);
    out.writeObject(key);
    byte[] keyBytes = o.toByteArray();
    ByteArrayInputStream bis = new ByteArrayInputStream(keyBytes);
    return bis;}
    public static byte[] getBytesFromKey(SecretKey key) throws Exception {
    ByteArrayOutputStream o = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(o);
    out.writeObject(key);
    byte[] keyBytes = o.toByteArray();
    return keyBytes; } }
    but it is giving following run-time error: Key Length263
    1
    <<======= insert result: true
    com.mysql.jdbc.Blob@1ea0252
    key172
    keyInputBinaryStream: java.io.ByteArrayInputStream@3e89c3
    keyInputBinaryStream: 263
    javax.crypto.spec.SecretKeySpec@fffe7a51
    Exception in thread "main" javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
    plzz suggest some solution...

  • Unicode problem while storing properties

    Hi,
    I need to store the java.util.Properties object to a file.
    I'm using the store(OutputStream out, String header) method. and am using FileOutputStream.
    The values in Properties object contain unicode characters.
    In the output file, they are stored as \u00E4
    Please help me in handling this.
    Thanks and Regards,
    Janardan

    Thanks for the reply.
    But I want the output file to be with unicode characters.
    Can't i acheive it without using other tools like native2ascii etc.
    or, is there any other way to store these key value pairs to a file?

  • Inserting Timestamp into a SQL database

    I am having a problem inserting a timestamp into a Sql Database. I keep getting this error or a different on when i format the timestamp differently. In the following code the timestamp is not formated at all.
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '13'
    this is the sql statement that is executed
    insert into timesheet(IDNUM,TimeIn,TimeOut,HoursWorked) values (123 , 2005-07-15 13:20:06.062 , 2005-07-15 13:20:06.062 ,0)
    the code is as follows:
         <%
         try
                SimpleDateFormat test = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
                Timestamp stamp = new Timestamp(System.currentTimeMillis());
                java.util.Date date = new java.util.Date();
                String sql = "insert into timesheet(IDNUM,TimeIn,TimeOut,HoursWorked) values (" + session.getAttribute("IDNum") + " , " + stamp + " , " + stamp + " ,0)";
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection cnxn = DriverManager.getConnection("jdbc:odbc:EmployeeSystem");
                Statement stmt = cnxn.createStatement();
                 stmt.execute(sql);
                response.sendRedirect("employee.jsp");
         catch(Exception dberr)
             SimpleDateFormat test = new SimpleDateFormat("yyyyMMddhhmm");
             Timestamp stamp = new Timestamp(System.currentTimeMillis());
             out.println(dberr);
             out.println("insert into timesheet(IDNUM,TimeIn,TimeOut,HoursWorked) values (" + session.getAttribute("IDNum") + " , " + stamp + " , " + stamp + " ,0)");
         %>please help.
    The reason that i need the timestamps in there is that i am creating a time clock program for my school that they can put on a intranet so thier hourly employees can use instead of the current manual system they use.

    even better would be to use prepared statements and set the fields via Timestamp objects.
    String sql = "insert into timesheet(IDNUM ,TimeIn ,TimeOut ,HoursWorked ) values (?,?,?,?)";
    Statement stmt = cnxn.prepareStatement(sql);
    int idNum = (Integer)session.getAttribute("IDNum").intValue();
    Timestamp stamp = new Timestamp(System.currentTimeMillis());
    stmt.setInt(1, idNum);
    stmt.setTimeStamp(2, stamp);
    stmt.setTimeStamp(3, stamp);
    stmt.setInt(4, 0);
    stmt.execute();It makes your code much more portable, as you don't have to worry about the database having a TO_DATE function with that syntax.
    Cheers,
    evnafets

  • Error while storing

    good day all i am facing problem while storing more then 4000 char in a table whose datatype is varchar2(4000)
    we use long datatype to solve this however while storing and retreiving we are facing the problem can any one assist ,
    appreciate your anticipation with your earliest
    Regards

    Obviously, you can't store more than 4000 characters in a varchar2(4000) column. Storing your data in a LONG column will solve this, though I'd highly recommend using CLOB rather than LONG. Oracle will probably drop the LONG type at some point since CLOB is so much nicer.
    Can you provide the precise error you're getting (including the ORA-xxxxx error number)? If you cuold post the code that's causing the error as well, that would be helpful.
    Justin

  • Memory leak problem while passing Object to stored procedure from C++ code

    Hi,
    I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code :
    1) created objects in oracle with the help of "create or replace type as objects"
    2) generated C++ classes corresponding to oracle objects with the help of OTT utility.
    3) Instantiating classes in C++ code and assigning values.
    4) calling oracle stored procedure and setting object in statement with the help of setObject function.
    5) deleted objects.
    this is all I am doing ,and getting memory leak , if you need the sample code then please write your e-mail id , so that I can attach files in reply.
    TIA
    Jagendra

    just to correct my previous reply , adding delete statement
    Hi,
    I am using oracle 10.2.0.1 and compiling the code with Sun Studio 11, following is the brief dicription of my code :
    1) create oracle object :
    create or replace type TEST_OBJECT as object
    ( field1 number(10),
    field2 number(10),
    field3 number(10) )
    2) create table :
    create table TEST_TABLE (
    f1 number(10),f2 number (10),f3 number (10))
    3) create procedure :
    CREATE OR REPLACE PROCEDURE testProc
    data IN test_object)
    IS
    BEGIN
    insert into TEST_TABLE( f1,f2,f3) values ( data.field1,data.field2,data.field3);
    commit;
    end;
    4) generate C++ classes along with map file for database object TEST_OBJECT by using Oracle OTT Utility
    5) C++ code :
    // include OTT generate files here and other required header files
    int main()
    int x = 0;
    int y = 0;
    int z =0;
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection* const pConn =
    env->createConnection"stmprf","stmprf","spwtrgt3nms");
    const string sqlStmt("BEGIN testProc(:1) END;");
    Statement * pStmt = pConn->createStatement(sqlStmt);
    while(1)
    TEST_OBJECT* pObj = new TEST_OBJECT();
    pObj->field1 = x++;
    pObj->field2 = y++;
    pObj->field3 = z++;
    pStmt->setObject(1,pObj);
    pStmt->executeUpdate();
    pConn->commit();
    delete pObj;
    }

  • Passing array of timestamps into oracle stored proc

    Hey there,
    I have an interesting problem. I need to pass an array of java.sql.Timestamp into a stored proc.
    I see that the PreparedStatement provides a setArray() method which takes as arguments an int, java.sql.Array
    Anybody know how I can use the java.sql.Array to my advantage here ? Basically, I don't see how I can create a java.sql.Array of Timestamps
    thanks in advance for all your help.
    Manish Mandelia

    The java.sql.Array implementation is provided by your jdbc driver.
    For exemple using Oracle you can obtain an sql.Array with something like this :
    Connection con=getConnection() // get a connection to the DB
    //first declare what type of array you will use in the DB
    // you probably want to replace CHAR(7) by Timestamp here
    PreparedStatement createArray=
    con.prepareStatement("CREATE OR REPLACE TYPE MYARRAY AS VARRAY(100) OF CHAR(7)");
    createArray.execute();          
    //then get an java instance of this Array
    oracle.sql.ArrayDescriptor arrayDescriptor = oracle.sql.ArrayDescriptor.createDescriptor("MYARRAY",con);
    // content is used to fill the Array
    String[] content= {"string0", "string1"};
    java.sql.Array sqlArray=new oracle.sql.ARRAY(arrayDescriptor, con, content);               
    // then call your stored procedure
    java.sql.CallableStatement callStmt=con.prepareCall("call MyStoredProcedure(?)");
    // passing the array as an argument
    callStmt.setArray(1,sqlArray);
    callStmt.execute();
    As you can see the code is quite database specific.
    hope that helps.

Maybe you are looking for

  • Creating and accessing a Table control using  CL_TABLE_VIEW_MM

    Hi everybody.,         I am new to Module Pool Programming using Abap Object Oriented Programming .I need to create a Table Control in my Screen .I debugged the standard ME21n Tracsaction and found that it used class  CL_TABLE_VIEW_MM  .How can i mak

  • USB cable not working

    Everytime i connect my USB it is not detected by PC....... I have tried with other PC'S but in vain....... Wht might be the problem??????????????????????????

  • Audiobook won't shuffle on ipod nano (and other related issues)

    I am learning German and I bought a set which comes with an audio companion that you can use on your MP3/ipod.  They come in units of no more than 3 minutes each and there are quite a few of them.  I uploaded the content onto iTunes. First of all iTu

  • OWB Error handling through error tables

    I have a mapping, which i want to implement error handling through error table, the table is created (error) and i have supplied it in the error table propertis in the target table. But i have tried testing if this is working by changing the data typ

  • Nexus 7010 OSPF Equal Cost Paths

    Hello, I currently have two physical links connecting one data center to another.  These are both 10Gb links and I have manually set the cost to the primary link to '1' and the secondary link to '10'.  My question is, if I set the secondary link to '