Map java.sql.Timestamp to JDBC-MySQL TIMESTAMP?
Java provides the java.sql.Timestamp class specifically to be able to make
use of the greater-accuracy timestamps provided in JDBC and underlying
datastores. Is there a way to set up a Kodo mapping file such that a
persistent class with a java.sql.Timestamp field, has this field map to a
TIMESTAMP field in the underlying database table?
Thanks,
-- Bryan
Yes, with a custom field mapping. See the example of a custom field
mapping for java.sql.Date in samples/ormapping. A mapping for timestamp
would be almost exactly the same.
Similar Messages
-
Caused by java.sql.SQLException: No JDBC connection can be made
Hi,
I am using OSB11g (with soa db adapter ) to select data from DB2 Database. I am trying to just fetch like 100 records(very less).
I get this Exception once in 4-5 tests I do . I am not sure if I have to modify any configurations, in case its timing out .
I see something like *"To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml)."*
I don't see the tables when I try to perform SELECT operation in db adapter. In JDev worksheet I can see the tables and records when queried.
BEA-380002: Invoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/SampleOSBEMEA/WSDL/DBOut [ DBOut_ptt::DBOut(DBOutInput_msg,DBOutOutputCollection) ] - WSIF JCA Execute of operation 'DBOut' failed due to: Pure SQL Exception.
Pure SQL Execute of SELECT Column1, Column2 ..........Column216 from Table.
Caused by java.sql.SQLException: No JDBC connection can be made
because the transaction state is
Rolledback.
; nested exception is:
BINDING.JCA-11633
Pure SQL Exception.
Caused by java.sql.SQLException: No JDBC connection can be made
because the transaction state is
Rolledback.
The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).
The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).
at oracle.tip.adapter.db.exceptions.DBResourceException.createXARetriableException(DBResourceException.java:670)
at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:642)
at oracle.tip.adapter.db.exceptions.DBResourceException.pureSQLException(DBResourceException.java:711)
at oracle.tip.adapter.db.puresql.PureSQLInteraction.executePureSQL(PureSQLInteraction.java:625)
at oracle.tip.adapter.db.DBInteraction.executePureSQL(DBInteraction.java:1146)
at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:254)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:529)
... 63 more
Caused by: java.sql.SQLException: No JDBC connection can be made
because the transaction state is
Rolledback
at weblogic.jdbc.jts.Driver.newConnection(Driver.java:949)
at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:327)
at weblogic.jdbc.jts.Driver.connect(Driver.java:173)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:126)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:94)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:327)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:291)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:558)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1433)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:302)
at oracle.tip.adapter.db.DBConnection.getTopLinkSQLConnection(DBConnection.java:333)
at oracle.tip.adapter.db.transaction.DBTransaction.beginInternal(DBTransaction.java:126)
at oracle.tip.adapter.db.puresql.PureSQLInteraction.executePureSQL(PureSQLInteraction.java:171)
... 66 more
Should I increase the time interval in weblogicra.xml (DEV/wls1034/middleware/Oracle_OSB1/lib/external/adapters/META-INF)
for <wls:connection-reserve-timeout-seconds>5</wls:connection-reserve-timeout-seconds>
Thanks
Edited by: soauser on Jul 6, 2011 10:02 AMLooks like either database is too slow or data-source is not functioning properly. Make sure to test data source and see if it is in running state and it has sufficient number of connections (you may increase max connections value). Actually transaction is getting rolled back because it could not get connection in specified time period (may be JTA/statement timeout).
Cross post in Weblogic JDBC forum as well for expert's advice -
WebLogic Server - JDBC
You may consider raising a case with support as well.
Regards,
Anuj -
Java.sql.SQLException: Error accessing jdbc driver
Hi,
We are using WebLogic Server 7.0 as Application Server.
We now create a connection pool named regPool and
a Tx datasource named regDS.
When we get the connection from the datasource, exception occurred.
java.sql.SQLException: Error accessing jdbc driver: driverURL =
jdbc:weblogic:pool:regPool, props = {enableTwoPhaseCommit=false,
jdbcTxDataSource=true, connectionPoolID=regPool}
at
weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:323)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:377)
at weblogic.jdbc.jts.Driver.connect(Driver.java:129)
at
weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java
:265)
So I guess that why we can't use CMP for finding data. Here is the error when we call the finder.
javax.ejb.FinderException: Exception in findAllEmr while preparing or
executing statement: 'null'
java.sql.SQLException: Cannot obtain connection after 30 seconds. ,
Exception = Access not allowed
java.sql.SQLException: Cannot obtain connection after 30 seconds. ,
Exception = Access not allowed
at
weblogic.jdbc.jts.Connection.wrapAndThrowSQLException(Connection.java:694)
According to the exception message, it looks
like the connection fail between WLS and Oracle 9.2.
Here is a scenario I think you should need to know.
I change the table-name in the weblogic-cmp-rdbms-jar.xml
to a name that doesn't exist in the database.
Then, re-package the EJB, copy it to server and restart the server.
A exception occurred that says the table doesn't exist.
So, in this case, it looks like the datasource works and
connection is fine.
Any recommendation will be appreciated.
Jimmy ChangHi!
I am a default user to the databse server. I connect to the database with '\' as the username and blank passoword(I mean with Network authentication may be).When I am trying to create connection using
con = DriverManager.getConnection("jdbc:oracle:thin:@DRACINAL2:BSAJ", "/","" )
it gives me followint error
ava.sql.SQLException: Null user or password not supported in THIN driver
void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
void oracle.jdbc.dbaccess.DBError.throwSqlException(int, java.lang.Object)
void oracle.jdbc.dbaccess.DBError.check_error(int)
oracle.jdbc.dbaccess.DBConversion oracle.jdbc.ttc7.TTC7Protocol.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
void oracle.jdbc.driver.OracleConnection.<init>(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
java.sql.Connection oracle.jdbc.driver.OracleDriver.getConnectionInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)
void textPack.GenTextFile.main(java.lang.String[])
How should I go about it?
Thanks for your help.
-Sreekanth Varidhireddy -
What is the diffrence between package javax.sql and java.sql
Is javax designed for J2EE?
And when to use package javax?Hi,
What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
1.The java.sql package and
2.The javax.sql package.
java.sql provides features mostly related to client
side database functionalities where as the javax.sql
package, which adds server-side capabilities.
You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
Hope this helps.
Good Luck.
Gayam.Srinivasa Reddy
Developer Technical Support
Sun Micro Systems
http://www.sun.com/developers/support/ -
Jdbc:mysql generating exception when ip address is included as part of url
hie
I recently wrote a java application that uses jdbc:mysql connector to connect to the mysql database. The problem I'm facing is ,- when ever I include IP addresses in the url on the getConnection method I get the following exception:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused: connect
The funny part is that if I use localhost on the url it works but generates the exception when I put the IP address of the local machine.
Anybody who knows where the problem is , please help
thanx in advancelocalhost usually resolves to 127.0.0.1, not the routable IP address of the host.
mysql (or any TCP/IP based program) can tell which IP address you connected via.
Your mysql installation apparently isn't configured to allow external connections. The problem could be persmissions or the installation itself, or a firewall on the host.
See the fine manual:
http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html
http://dev.mysql.com/doc/refman/5.1/en/connection-access.html
http://dev.mysql.com/doc/refman/5.1/en/security-guidelines.html -
MS SQL Server 2K JDBC Connection Problem
Hi,
I have installed Sql Server 2000 with mixed mode authentication. I am able to connect to connect through ODBC with both Windows and server authentication.
The same when i try with JDBC, i am not able to connect. I have added the driver jars to the classpath also.
Heres the Code :
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con = java.sql.DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=pubs","sa","");
if(con!=null) System.out.println("Connection Successful!");
}catch(Exception e){
e.printStackTrace();
System.out.println("Error Trace in getConnection() : " + e.getMessage());
Here is the error :
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at Connect.main(Connect.java:31)
Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver
Kindly help.
Thanks in AdvanceThanks for the reply.
I am not using any IDE, but the problem exists if i
add the jar files into my classpath. I extracted the
required files as suggested and tried, this time it
works fine.
If anyone could let me know why this problem is
occuring it would be helpful.
Thanks once againIt occured because MS didn't package their jar properly. You could try to re-jar the files or use a driver from another vendor. -
One of our customers starts to encounter this error message recently.
We checked our log files. It seems that the error happens when
to obtain a jdbc connection. Have anyone seen similar problems
and knows how to fix it? thanks in advance.
We are using weblogic server 6.1sp2, and weblogic sql type 4 driver.
The functions that invoke the jdbc calls are stateless session bean
methods with their transaction attributes marked as Required.
There is no nested calls of these methods.
A partial stack trace we obtained is as following:
java.sql.SQLException: No JDBC connection can be made
because the transaction state is
Marked Rollback
at weblogic.jdbc.jts.Connection.getOrCreateConnection(Connection.java:586)
at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:115)
at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
lixinJoseph Weinstein <[email protected]> wrote:
>
>
YuanHui Liu wrote:
Joe,
We got the exact same error message. The error came after we got theJDBC connection,
and trying to create statement off it.
It occurs intermitently when we are running another standalone JAVAapp to do
some end of day work, which results in the DB Server being very busy(90+%CPU
usage) for about 5 minutes. We see a surge of requests to the WLSJDBC Connection
pool. This would sometimes result in all our subsequent DB requeststo fail and
lead to a crash.
We are using WLS6.0SP1. I do not think there's a 30 seconds wait leadingto a
connection timeout that caused this(rather it is the end effect).
Can you give us a more detailed explanation? Is there a miscommunicationbetween
our DB(Sybase12) and WLS?Hi. It looks to you like it's after you get the connection, but really
it's when the server is
gettng the pool connection. For performance/synchronization reasons we
do a clever
delay: When your code asks for a pool connection we quickly give you
the pool wrapper,
but we delay actually reserving the real underlying DBMS connection until
your first
real need for a connection, at your first JDBC call, such as createStatement()
etc.
It is while waiting for a pool connection long enough for the transaction
coordinator
to have timed you out before you ever get a chance. It's nothing to do
with the
DBMS or even JDBC, I believe. I think the weblogic server either has
too few execute-threads
and/or too few CPU cycles to do the work load.
Okay, so there's a lazy initialization of the connection.
From reading our log I believe our failur is immediate rather
than waiting for 30+ seconds(the default setting) from the DB,
the timeout occurred later as a result. At the time either because the DB Server
is very busy.
Since we are running WLS6.0 we have only one connection pool,
we have defined a max of 150 threads in the pool. While this
is happening the DB Server is being pinned by an overnight job,
but the WLS Server is not busy at all. The DB and WLS resides
on different physical boxes.
We also have a thread dump from the WLS console when we rebooted the server, it
showed that we are hanging on to the thread & jdbc
connections after these exceptions has occurred instead of releasing them, note
"16083"(~4.5 hours) seconds has passed:
142 116222 Retry rollback request for tx: 'transaction=(IdHash=2963855,Name =
[EJB UserManagerBeanImpl.signalICUserServletHeartBeat()],Xid=30643:8f3838f3709bf53d,Status=Rolling
Back. [Reason = Unknown],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since
begin=16083,seconds left=10,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=started,assigned=server),SCInfo[server]=(state=active),properties=({weblogic.jdbc=t3://159.55.158.25:8005,
weblogic.transaction.name=[EJB UserManagerBeanImpl.signalICUserServletHeartBeat()]}))'
Scheduled Trigger
So I would argue this problem actually chewed up resources on the WLS server.
-Yuanhui Liu
>>
>>
Thanks.
-YuanHui Liu
Joseph Weinstein <[email protected]> wrote:
lixin wrote:
One of our customers starts to encounter this error message recently.
We checked our log files. It seems that the error happens when
to obtain a jdbc connection. Have anyone seen similar problems
and knows how to fix it? thanks in advance.
We are using weblogic server 6.1sp2, and weblogic sql type 4 driver.
The functions that invoke the jdbc calls are stateless session bean
methods with their transaction attributes marked as Required.
There is no nested calls of these methods.
A partial stack trace we obtained is as following:
java.sql.SQLException: No JDBC connection can be made
because the transaction state is
Marked Rollback
at weblogic.jdbc.jts.Connection.getOrCreateConnection(Connection.java:586)Hi. This sounds like a JVM thread starvation issue, and/or a server
load
issue. What is
happening is that the transaction is started, and times out beforethe
SSB even gets to
the first JDBC work. I would first verify that the customer is using
the very latest JVM
available for the machine.
Joe Weinstein
at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:115)
at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
lixin -
SQL Server 2000 Jdbc connection
I just have a small question and I was wondering if anyone could help me out with it? I'm using a JSP page to connect up to the database on the server. I have the JDBC driver and am trying to connect from my machine to SQL Server 2000 on our server. The thing is I'm having a little trouble with the connection string.
(i am using the Microsoft SQL Server 2000 JDBC Driver)
Can you use Windows Authentication when using the connection string?
Also i tried using a SQL Server connection but it gave me the error : "com.microsoft.sqlserver.jdbc.SQLServerExcepti on: Login failed for user 'Arun'. The user is not associated with a trusted SQL Server connection. "
This is the connection string
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection connection1 = java.sql.DriverManager.getConnection("jdbc:sqlserver://localhost:1433;Database=BusinessDatabase","Arun","testpass");can you set it up for windows authentication?
thanks for any help anyone can give me with this! <img src="http://www.java-forums.org/images/smilies/smile.gif" border="0" alt="" title="Smile" width="16" height="16" />Hi,
Yes, it is possible to use Windows Authentication but you will need to make sure the sqljdbc_auth.dll file is in your system path specified with the -Djava.library.path="xxx" option. The dll is included as part of the JDBC Driver download.
Hope this helps.
Ben. -
Hi,
I am working on resultset.updateRow() and found some problem.
I've tried the same jsp page on 2 WebLogic server
one is on a Solaris Platfoem and another is on a NT platform
On NT Platform it seems to be OK and update the database successfully.
On Solaris, on error message on WebLogic log but error found in the JDBC log
java.sql.SQLException: Non supported character set: oracle-character-set-860
P.S. both jsp page connection to the same database server Oracle 8
The testing JSP page:
<%@ page language="java" import="java.sql.*, oracle.jdbc.driver.*,
java.util.*, javax.sql.*" %>
<html>
<head>
<title>Weblogic Oracle Testing - Store Procedure</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
Oracle Connection Testing
<br>
<body bgcolor="#FFFFFF">
<%
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String sql;
Driver myDriver =
(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
try {
conn=DriverManager.getConnection("jdbc:oracle:thin:sa/z0y1z2y3@oradev01:1521
:DEV01a");
DatabaseMetaData DBMetaData = conn.getMetaData();
boolean support1 =
DBMetaData.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE);
boolean support2 =
DBMetaData.supportsResultSetType(ResultSet.CONCUR_UPDATABLE);
%>
<p><%=support1%></p>
<p><%=support2%></p>
<%
//create a statement
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
//execute a query
rs = stmt.executeQuery("SELECT tbl_web_trx_hdr.* FROM tbl_web_trx_hdr");
int concurrency = rs.getConcurrency();
int type = rs.getType();
%>
<p>concurrency: <%=concurrency%></p>
<p>type: <%=type%></p>
<%
rs.moveToInsertRow();
rs.updateString("org_idx", "CCC");
rs.updateString("trx_num", "ABC2");
rs.updateDate("trx_dte", java.sql.Date.valueOf("2001-06-01"));
rs.updateString("description", "123");
rs.insertRow();
rs.updateRow();
} catch (SQLException e)
{ System.out.println("SQLMessage: " + e.getMessage());
finally
{ rs.close();
stmt.close();
conn.close(); }
%>
</body>
</html>
Please help
regards,
Fannieyupp finally i got the solution. . .
I was using connection from tomcat connection pooling.
Hence, even though i was setting the classes12.jar and nls_charset12.jar in the classpath and compiling, -In runtime tomcat was using its own classes in the common/lib folder. . .(which might not support oracle-character-set-178.)
So just added this jars into the common/lib of tomcat instead of web-inf/lib of my project
and things began working. . .
Thanks for the hint jshell. . . -
I am running small SQLJ in a JSP to get the hang of it.
I am running on 920, and have downloaded the new runtime classes for 920 and tested per the instructions.
Using JDev 903, here is the private method for running a query ( It is from an article I found by Julie Basu at Oracle; I have played around with the empno/emp_no variable to convert it to an int):
<%! private String runQuery(String emp_no) throws java.sql.SQLException {
DefaultContext dctx =null;
String ename = null; double sal = 0.0; String hireDate=null;
StringBuffer sb = new StringBuffer();
//int emp_no = Integer.parseInt(emp_no);
try {
dctx =Oracle.getConnection("jdbc:oracle:oci8:@olap","scott","tiger");
#sql [dctx] { SELECT ename, sal, TO_CHAR(hiredate,'DD-MON-YYYY')
INTO :ename,:sal,:hireDate
FROM scott.emp WHERE empno=:emp_no
sb.append("<BLOCKQUOTE><BIG><B><PRE>\n");
sb.append("Name :"+ename+ "\n");
sb.append("Salary :"+sal+ "\n");
sb.append("Date hired :"+hireDate);
sb.append("</PRE></B>></BIG></BLOCKQUOTE>");
} catch (java.sql.SQLException e){
sb.append("<P> SQL Error: <pre> "+e+" </pre> </p>\n");
} finally {
if (dctx!=null) dctx.close();
return sb.toString();
%>
I keep getting the following error:
java.lang.NoSuchFieldError: oracle.jdbc.oci8.OCIEnv.envCharSetId
int oracle.jdbc.oci8.OCIEnv.get_env_handle()
native code
long oracle.jdbc.oci8.OCIEnv.getEnvHandle()
OCIEnv.java:70
oracle.jdbc.dbaccess.DBConversion oracle.jdbc.oci8.OCIDBAccess.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
OCIDBAccess.java:390
void oracle.jdbc.driver.OracleConnection.<init>(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
OracleConnection.java:361
java.sql.Connection oracle.jdbc.driver.OracleDriver.getConnectionInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
OracleDriver.java:485
java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
OracleDriver.java:337
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
DriverManager.java:517
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)
DriverManager.java:177
void sqlj.runtime.ref.ConnectionContextImpl.<init>(sqlj.runtime.ref.ProfileGroup, java.lang.String, java.lang.String, java.lang.String, boolean)
ConnectionContextImpl.java:346
void sqlj.runtime.ref.DefaultContext.<init>(java.lang.String, java.lang.String, java.lang.String, boolean)
DefaultContext.java:172
sqlj.runtime.ref.DefaultContext oracle.sqlj.runtime.Oracle.getConnection(java.lang.String, java.lang.String, java.lang.String, boolean)
Oracle.java:580
sqlj.runtime.ref.DefaultContext oracle.sqlj.runtime.Oracle.getConnection(java.lang.String, java.lang.String, java.lang.String)
Oracle.java:609
java.lang.String _SQLJ.runQuery(java.lang.String)
[SQLJ.jsp]
SQLJ.jsp:42
void SQLJ.jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
[SQLJ.jsp]
SQLJ.jsp:20
void com.orionserver[Oracle9iAS (9.0.3.0.0) Containers for J2EE].http.OrionHttpJspPage.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
OrionHttpJspPage.java:56
[SRC:/SQLJ.jsp]
void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
JspPageTable.java:317
void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
JspServlet.java:465
void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
JspServlet.java:379
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
HttpServlet.java:853
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
ServletRequestDispatcher.java:721
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
ServletRequestDispatcher.java:306
boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
HttpRequestHandler.java:767
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
HttpRequestHandler.java:259
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
HttpRequestHandler.java:106
void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
PooledExecutor.java:803
void java.lang.Thread.run()
Thread.java:484
When I run it using just JDBC with the thin Driver, I have no problems.
What could be the issue?
Thanks,
Scott RappoportFail to make OCI connection Using JDeveloper
-
A silly question about oracle.sql.timestamp and java.sql.timestamp
Hi,
I'm looking at a method that takes objects of type Object and does stuff if the object is really a java.sql.timestamp. If it is not then an error is flagged. In my case it flags an error when an object of type oracle.sql.timestamp is passed to it. Not really entirely comfortable with java (i'm still learning it), here's my stupid question :- why isn't oracle.sql.timestamp a subclass of java.sql.timestamp? Also in various books it indicates that java.sql.timestamp maps to oracle.sql.timestamp. Does that mean you have to physically do the mapping:
i.e.
java.sql.Timestamp t = new Timestamp( new oracle.sql.Timestamp( CURRENTTIMESTAMP ).timestampValue() );
or is there something else to it.
Thanks.
Harold.The best forum for this is probably Forum Home » Java » SQLJ/JDBC
Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum. -
How do I return a java.sql.Timestamp data type in a Web service?
I'm new to workshop and java. I'm creating a mini application to simulate a real work Web Service (development environment is on an intranet). I was able to completely simulate the Web Services minus all date values.
I'm using a standard weblogic workshop database controls that are feeding the various WebServices and their methods (Web services was generated from DB control). I get a java type not support error when I attempt to return a java.sql.Timestamp. I temporarily got around the problem by omitting all dates from the sql.
However, we are at the point where we need the complete record.
My two questions
1) What java data type do I convert the java.sql.Timestamp to
2) Where and how do I do it in workshop.
Thanks in advance
Derrick
Source view from workshop looks something like this.
public interface MyData extends DatabaseControl, com.bea.control.ControlExtension
static public class dbOverallRec
public String key;
public String field1;
public int field2;
public java.sql.Timestamp create_date
public dbOverallRec () {};
*@jc:sq; rowset-name="OverallRowSet" statement::
*select key, field1, field2 ,create_date from overall where key={KEY}::
dbOverallRec getOverallByKey(String Key);
* I had to omit the create_date to get it to workYou should try changing java.sql.Timestamp to java.util.Calendar.
java.util.Calendar maps to the dateTime type in XML Schema, and TIMESTAMP as a JDBC type.
Regards,
Mike Wooten -
Usage of java.sql.Timestamp with classes12.zip and ojdbc14.jar ?
Hi all,
If i'm using java.sql.Timestamp with classes12 it is functioning perfectly,
if i'm using ojdbc14 and java.sql.Timestamp it is functioning in different way and failing to do the action..
Example : update set xxx=yy where time = my Timestamp object set in Prepared statement
Hope to see the answerhttp://forum.java.sun.com/thread.jspa?threadID=460615&messageID=2116517
Timestamp insert problem
Using the "classes12.zip" file that comes with the distribution for Oracle versions 8.1.6.x and 8.1.7.x, Oracle's DATE datatype is mapped to the "java.sql.Timestamp" class. However, the "ojdbc14.jar" driver maps DATE to "java.sql.Date", and "java.sql.Date" only holds a date (without a time), whereas "java.sql.Timestamp" holds both a date and a time. -
ie. Is this valid?
<query>
<description>Find data between dates</description>
<query-method>
<method-name>findMetricsByDate</method-name>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql>
SELECT OBJECT (o) FROM MetricResults AS o WHERE MetricResults.date > ?1 AND MetricResults.date < ?2
</ejb-ql>
</query>No. Not with current EJB 2.0 CMP specs at least. Later revisions are supposed to fix this, but for now, this seriously limits the usefulness of EJB-QL.
.P. -
RQL Error - JQuery Datepicker and java.sql.Timestamp
Hello everyone,
I am using JQuery Datepicker to select start and end date range.
Both start date and end date are successfully passed as like this. 10/01/2013 and 10/31/2013
It has java.sql.Timestamp mapping in both startDate and endDate.
Property name in component browser is transactionTimestamp.
It gives me following error when i passed both parameters.
<dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
<dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
<dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
<dsp:param name="queryRQL" value="transactionTimestamp>=:startDate AND transactionTimestamp<:endDate" />
**** Error Wed Oct 02 16:07:21 IST 2013 1380710241490 /atg/dynamo/droplet/RQLQueryForEach unable to parse/execute query due to RepositoryException CONTAINER:atg.repository.RepositoryException; SOURCE:java.sql.SQLException: java.sql.SQLDataException: ORA-01843: not a valid month
It gives NO error when i passed single parameter.
<dsp:param name="queryRQL" value="transactionTimestamp>=:startDate"/>
can anyone suggest me a solution.
Thanks
saminda konkaduwaHi all,
Found the solution. We have to use parameter converter tools as well. that is the additional parameter called "date" where we passed date format.
<dsp:param name="startDate" param="10/12/2012" date="MM/dd/yyyy"/>
<dsp:param name="endDate" param="10/12/2015" date="MM/dd/yyyy"/>
Explanation :
JSP FILE ( testing.jsp)
=================
<dsp:page>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="merchant_portal_ajax_agent_report.js"></script>
<script type="text/javascript">
$(function() {
$("#startDate").datepicker();
$(function() {
$("#endDate").datepicker();
</script>
</head>
<body>
<table>
<tr>
<td>Start Date</td>
<td><input type="text" id="startDate" class="picker" name="sDate" /></td>
<td>End Date</td>
<td><input type="text" id="endDate" class="picker" name="sDate" /></td>
<td><input value="Find" type="submit" class="atg_button" onclick="loadAgentReport()" /></td>
</tr>
<tr>
<div id="agentReportTable"></div>
</tr>
</table>
</body>
</dsp:page>
JAVA SCRIPT FILE (merchant_portal_ajax_agent_report.js)
============================================
function loadAgentReport() {
var startDateValue = $("#startDate").val();
var endDateValue = $("#endDate").val();
$(document).ready(function() {
$.ajax({
type : "POST",
url : "merchant_portal_view_agent_report.jsp",
data : {
startDate : "" + startDateValue + "" , endDate : "" + endDateValue + ""
success : function(result) {
$("#agentReportTable").html("");
$("#agentReportTable").html(result);
JSP File ( This invoked by Jquery ) merchant_portal_view_agent_report.jsp
=======================================================
<dsp:page>
<dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
<dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
<dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
<dsp:param name="queryRQL" value="agentId=:agentId AND transactionTimestamp>:startDate AND transactionTimestamp<:endDate" />
<dsp:oparam name="output">
<dsp:valueof param="element.transactionId"/> <dsp:valueof param="element.transactionStatus"/>
</br>
</dsp:oparam>
<dsp:oparam name="empty">
No data found
</dsp:oparam>
</dsp:droplet>
</dsp:page>
Thanks
saminda konkaduwa
Maybe you are looking for
-
Somehow, I'm not getting all of my email (via iCloud). My wife forwared an email to me, I got the "ding" but no email. She sent it to another IMAP account that I have and I got it just fine. She repeatedly tried to send it to my .mac account and n
-
ESB errors not propagating to BPEL process
I am working in SOA Suite 10.1.3.3. I have an asynchronous BPEL process that is orchestrating a number of ESB services, most of which perform database operations. Occasionally an attempt is made to insert a record into a table which results in an err
-
I was wanting to use one of my images as a folder icon, and found that most of my photos have a frame around them, and have the generic Preview icon for their image (in the Get Info panel). I found one with the actual image as its icon in the Get Inf
-
Storage Issue: 206gb of movies?
Hi Everyone, My MBP has a 500gb hard drive. The storage meter says 206gb is taken up by movies, but I do not have any movies on this machine...Or at least I don't think I do. Is there any way to find these "movies" or is this some other weird probl
-
What is SAP best practice for SU24 "no check" indicators
Hi Experts, Let's say during testing if we find a t-code needs some authorization objects for end to end execution, and those objects are maintained as "CHECK" "NO" in USOBX_C. Please suggest the best practice... Should we change the proposal in USOB