Problem with java.sql.Clob and oracle.sql.CLOB
Hi,
I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below
java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);
lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));
lResourceStatus = true;
can anybody please tell me the what is the problem with this and solution.
thanks,
Ashok.
Hi Ashok
You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").
Just check your classpath and see if you are referring to the correct jar files.
cheers
Sameer
PS: Please award points if you find the answer useful
Similar Messages
-
Problem with java swing button and loop
Problem with java swing button and loop
I�m using VAJ 4.0. and I�m doing normal GUI application. I have next problem.
I have in the same class two jswing buttons named start (ivjGStart) and stop (ivjGStop) and private static int field named Status where initial value is 0. This buttons should work something like this:
When I click on start button it must do next:
Start button must set disenabled and Stop button must set enabled and selected. Field status is set to 1, because this is a condition in next procedure in some loop. And then procedure named IzvajajNeprekinjeno() is invoked.
And when I click on stop button it must do next:
Start button must set enabled and selected and Stop button must set disenabled.
Field status is set to 0.
This works everything fine without loop �do .. while� inside the procedure IzvajajNeprekinjeno(). But when used this loop the start button all the time stay (like) pressed. And this means that a can�t stop my loop.
There is java code, so you can get better picture:
/** start button */
public void gStart_ActionEvents() {
try {
ivjGStart.setEnabled(false);
ivjGStop.setEnabled(true);
ivjGStop.setSelected(true);
getJTextPane1().setText("Program is running ...");
Status = 1;
} catch (Exception e) {}
/** stop button */
public void gStop_ActionEvents() {
try {
ivjGStart.setEnabled(true);
ivjGStart.setSelected(true);
ivjGStop.setEnabled(false);
getJTextPane1().setText("Program is NOT running ...");
Status = 0;
} catch (Exception e) {
/** procedure IzvajajNeprekinjeno() */
public void IzvajajNeprekinjeno() { //RunLoop
try {
int zamik = 2000; //delay
do {
Thread.sleep(zamik);
PreberiDat(); //procedure
} while (Status == 1);
} catch (Exception e) {
So, I'm asking what I have to do, that start button will not all the time stay pressed? Or some other aspect of solving this problem.
Any help will be appreciated.
Best regards,
TomiThis is a multi thread problem. When you start the gui, it is running in one thread. Lets call that GUI_Thread so we know what we are talking about.
Since java is task-based this will happen if you do like this:
1. Button "Start" is pressed. Thread running: GUI_Thread
2. Event gStart_ActionEvents() called. Thread running: GUI_Thread
3. Method IzvajajNeprekinjeno() called. Thread running: GUI_Thread
4. Sleep in method IzvajajNeprekinjeno() on thread GUI_Thread
5. Call PreberiDat(). Thread running: GUI_Thread
6. Check status. If == 1, go tho 4. Thread running: GUI_Thread.
Since the method IzvajajNeprekinjeno() (what does that mean?) and the GUI is running in the same thread and the event that the Start button has thrown isn't done yet, the program will go on in the IzvajajNeprekinjeno() method forever and never let you press the Stop-button.
What you have to do is do put either the GUI in a thread of its own or start a new thread that will do the task of the IzvajajNeprekinjeno() method.
http://java.sun.com/docs/books/tutorial/uiswing/index.html
This tutorial explains how to build a multi threaded gui.
/Lime -
ConnectionPool problems with WLS 7.0 and Oracle 9.2
Hi,
We are using WLS 7.0 SP4, and Oracle 9 and the Oracle thin driver type 4. In our
application on the productive system (and only there) we constantly encounter
a whole set of SQLExceptions which have all in common that the Connection from
the pool is not valid any more when the application tries to use it.
Typical, recurring error messages are:
- Exhausted ResultSet
- Connection has already been closed
- Closed Statement
- Transaction is no longer active - status committing
- NullPointerException at
weblogic.jdbc.pool.Connection.prepareStatement()
There are no special Statements which create these errors. They are spread at
random across practically every query the application creates, and the same queries
sometimes succeed and sometimes fail.
I double and triple checked that all Connections, Statements and ResultSets are
closed immediately after use. As an example, I attached a code snippet and a resulting
StackTrace which.
The problem also seems to occur only with an (unknown) minimum of concurrent usern,
since in the approval tests on an almost identical test system these errors never
occurred.
I also followed the advice from Oracle and installed the latest Oracle JDBC driver
(Oracle 10g) - to no avail.
What else can I do?
Another question: Is it correct that my Oracle JDBC driver is in the application
classpath (via a reference in the Manifest file of the application jar), not in
the system classpath? There has never been a problem with that, but in a Newsgroup
answer from Nov 10, 2003 (subject: "ResultSet closes prematurely"), Joe Weinstein
suggested to "get it listed at the
front of the -classpath argument that the startWebLogic script creates for the
java line that starts the server".
I hesitate to do so, since the driver is in a standard WebApp- directory, WEB-INF/lib.
Is it possible and safe to add a jar located there to the system classpath? If
it is possible, why is it necessary?
Best regards,
Andreas Zehrt
[CodeSnippetsAndStackTraceForConnectionPoolProblem.txt]Andreas Zehrt wrote:
Hi Joe,
Your hint that there is a threading problem was right:
On further investigation of the code I found out that the class that passes the
Connection to the DAO not only stores it as a member at some point (which is not
a good idea anyway) but is also a singleton - then, of course, it's no surprise
that the Connection gets invalid in a incalculable way when concurrent threads
share it.
The singleton instantiation was not so obvious because the way of instantiation
is controlled by a configuration parameter that can be overridden at different
levels.
I changed it and the productive logfiles indicate that the SQLExceptions related
to that class have disappeared.I am happy to have helped.
So, thanks a lot for the advice.
But I am still wondering why this code has worked for so long a time with WLS
5.1 and Oracle 8 (the system has been productive for over 2 years). Even in the
approval tests with WLS 7.0 and Oracle 9, we did not run into problems, although
it was multi-user environment.Mo idea.
I still believe that there is a difference between WLS 5.1 and 7.0 in the way
it treats pooled Oracle JDBC Connections. I wished both Oracle and Bea could be
a little more explicit about those changes and possible version incompatabilities
beyond the general advice "use the latest thin driver".Though I can think of no change to our pooling which would have had any material
effect in this case, I will certainly do what I can to see that our documentation
is explicit about changes.
Joe
Best regards, Andreas
Joe Weinstein <[email protected]> wrote:
Hi Andreas.
Andreas Zehrt wrote:
Hi,
We are using WLS 7.0 SP4, and Oracle 9 and the Oracle thin driver type4. In our
application on the productive system (and only there) we constantlyencounter
a whole set of SQLExceptions which have all in common that the Connectionfrom
the pool is not valid any more when the application tries to use it.
Typical, recurring error messages are:
- Exhausted ResultSetThat is typically if the statement that created it is either re-executed
or closed.
- Connection has already been closedAs described. If you give a stacktrace, we could make a debug patch which
would show
where it was originally closed.
- Closed Statementsame as above.
- Transaction is no longer active - status committingThat implies your code is obtaining a connection from a transactional
datasource,
and then later trying to use it after the transaction which it was associated
with,
is finished.
- NullPointerException at
weblogic.jdbc.pool.Connection.prepareStatement()Maybe any of the above.
There are no special Statements which create these errors. They arespread at
random across practically every query the application creates, andthe same queries
sometimes succeed and sometimes fail.
I double and triple checked that all Connections, Statements and ResultSetsare
closed immediately after use. As an example, I attached a code snippetand a resulting
StackTrace which.
The problem also seems to occur only with an (unknown) minimum of concurrentusern,
since in the approval tests on an almost identical test system theseerrors never
occurred.
I also followed the advice from Oracle and installed the latest OracleJDBC driver
(Oracle 10g) - to no avail.
What else can I do?
Another question: Is it correct that my Oracle JDBC driver is in theapplication
classpath (via a reference in the Manifest file of the applicationjar), not in
the system classpath? There has never been a problem with that, butin a Newsgroup
answer from Nov 10, 2003 (subject: "ResultSet closes prematurely"),Joe Weinstein
suggested to "get it listed at the
front of the -classpath argument that the startWebLogic script createsfor the
java line that starts the server".
I hesitate to do so, since the driver is in a standard WebApp- directory,WEB-INF/lib.
Is it possible and safe to add a jar located there to the system classpath?If
it is possible, why is it necessary?I was only concerned to ensure we know which driver we are working with.
We also ship
an oracle thin driver, which becomes obsolete soon...
I am concerned that your code creates pool connections to be used later.
The problems
can arise if more than one thread ever gets the same connection, or if
the connection
is used in the same thread, spanning transactions. It does also seem
that there may
be a threading issue, because if two threads each call the code to create
a connection,
and two connections are made, but one over-writes the other, the two
threads can
end up using the same connection, and closing it. The over-written one
never gets closed,
resulting in that leak message you got...
Joe
The Connection parameter is opened by a business component class, ComaServiceProviderClassicImpl.It is propagated through
several classes in the business layer, but not used, until the DAOtakes it to make the query.
So, the Connection is closed where it was opened, not in the DAO class.
public class ConcernDAOImpl extends BaseDAO {
public Collection getConcernsForIncidents(Connection conn, Collectionincidents)
throws DataAccessException, ConstraintException, ComaParseException{>
sqlMessage.append(")");
String sqlStmt = sqlMessage.toString();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sqlStmt);
rs = pstmt.executeQuery();
while (rs != null && rs.next()) {
final Concern concern =
new Concern(DAOUtil.getComaOID(rs, ComaDBNames.KDANR));
concern.setIncidentOID(DAOUtil.getComaOID(rs, ComaDBNames.KDAVGENR));
return concerns;
} catch (SQLException sqle) {
// Wrapps real SQL exception
String[] message = new String[]{sqle.getMessage(), sqlStmt};
throw new DataAccessException(ExpCode.S_ORACLE_SQL, message,
sqle);
} finally {
closeAll(rs, pstmt);
_logger.exitDebug(method);
Here, the Connection is acquired and finally closed
public class ComaServiceProviderClassicImpl {
public void updateComplaint(
final Request updateRequest,
final ResponseSingleElement response,
final Principal principal)
throws SystemException {
try {
logger.info("updateComplaint", "store incident");
// store the incident in the database
incidentManager.storeIncident(getConnection(), updateIncident);
// reload the incident from Cache and / or the databaseto get the ContactReferences.
Incident returnIncident = incidentManager.loadIncident(//IncidentManager passes the Connection to the DAO
getConnection(), updateIncident.getOID());
} catch (RemoteException rex) {
// remote exceptions
rollbackIfNecessary();
CoreUtils.unwrapRemoteException(rex, logger);
} catch (SystemException e) {
// all other exceptions --> rollback if necessary and rethrow
rollbackIfNecessary();
throw e;
} finally {
removeConnection();
logger.exitDebug("updateComplaint");
This is the resulting StackTrace:
sql exception: [Closed Statement: next] - sql statement: [select *
at de.deutschepost.ubbrief.coma.persistence.dao.ConcernDAOImpl.getConcernsForIncidents(ConcernDAOImpl.java:363)
at de.deutschepost.ubbrief.coma.persistence.dao.CachingConcernDAOImpl.getConcernsForIncidents(CachingConcernDAOImpl.java:129)
at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadConcernStructuresIntoIncidents(IncidentManagerImpl.java:1067)
at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadStructureForIncident(IncidentManagerImpl.java:320)
at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadIncidents(IncidentManagerImpl.java:264)
at de.deutschepost.ubbrief.coma.persistence.taskmanager.TaskManagerImpl.selectTasksForUser(TaskManagerImpl.java:299)
at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Impl.getTaskList(ComaServiceProviderZ2Impl.java:113)
at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Bean_1dhrj7_EOImpl.getTaskList(ComaServiceProviderZ2Bean_1dhrj7_EOImpl.java:154)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList.runServiceMethod(CMPGetTaskList.java:64)
at de.deutschepost.ubbrief.coma.sbbx.sp.BasicMethodProvider.execute(BasicMethodProvider.java:145)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl.execute(CMPGetTaskList_9b9mv5_EOImpl.java:46)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLSkel.invoke(UnknownSource)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLStub.execute(UnknownSource)
at de.deutschepost.ubbrief.backbone.jazz.impl.core.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:115)
at de.deutschepost.ubbrief.backbone.common.impl.core.rpc.server.ServerKernelImpl.handleTransportMessage(ServerKernelImpl.java:270)
at de.deutschepost.ubbrief.backbone.common.impl.core.messaging.MessageTransport.handleMessage(MessageTransport.java:454)
at de.deutschepost.ubbrief.backbone.common.impl.core.KernelFacade.handleMessage(KernelFacade.java:209)
at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean.messageArrived(BackboneBean.java:637)
at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean_ina9d7_ELOImpl.messageArrived(BackboneBean_ina9d7_ELOImpl.java:105)
at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.LocalQueueReceiveBean.deliverMessage(LocalQueueReceiveBean.java:43)
at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.AbstractMessageReceiveBean.onMessage(AbstractMessageReceiveBean.java:127)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:377)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:311)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:286)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2351)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2267)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
####<May 26, 2004 12:18:43 PM CEST> <Warning> <JDBC> <S0048016> <REMA20Z><Finalizer> <kernel identity> <> <001074> <A JDBC pool connection leak
was detected. A Connection leak occurs when a connection obtained from
the pool was not closed explicitly by calling close() and then was disposed
by the garbage collector and returned to the connection pool. The following
stack trace at create shows where the leaked connection was created.
Stack trace at connection create:
at weblogic.jdbc.pool.Connection.<init>(Connection.java:66)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:294)
at weblogic.jdbc.pool.Driver.connect(Driver.java:210)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:373)
at weblogic.jdbc.jts.Driver.connect(Driver.java:129)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:287)
at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnectionFromPool(ComaComponentImpl.java:163)
at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnectionInternal(ComaComponentImpl.java:135)
at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnection(ComaComponentImpl.java:99)
at de.deutschepost.ubbrief.coma.persistence.customermanager.CurryCustomerManagerImpl.findCustomers(CurryCustomerManagerImpl.java:73)
at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2BaseImpl.resolveCustomerInstances(ComaServiceProviderZ2BaseImpl.java:808)
at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Impl.getTaskList(ComaServiceProviderZ2Impl.java:213)
at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Bean_1dhrj7_EOImpl.getTaskList(ComaServiceProviderZ2Bean_1dhrj7_EOImpl.java:154)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList.runServiceMethod(CMPGetTaskList.java:64)
at de.deutschepost.ubbrief.coma.sbbx.sp.BasicMethodProvider.execute(BasicMethodProvider.java:145)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl.execute(CMPGetTaskList_9b9mv5_EOImpl.java:46)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLSkel.invoke(UnknownSource)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLStub.execute(UnknownSource)
at de.deutschepost.ubbrief.backbone.jazz.impl.core.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:115)
at de.deutschepost.ubbrief.backbone.common.impl.core.rpc.server.ServerKernelImpl.handleTransportMessage(ServerKernelImpl.java:270)
at de.deutschepost.ubbrief.backbone.common.impl.core.messaging.MessageTransport.handleMessage(MessageTransport.java:454)
at de.deutschepost.ubbrief.backbone.common.impl.core.KernelFacade.handleMessage(KernelFacade.java:209)
at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean.messageArrived(BackboneBean.java:637)
at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean_ina9d7_ELOImpl.messageArrived(BackboneBean_ina9d7_ELOImpl.java:105)
at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.LocalQueueReceiveBean.deliverMessage(LocalQueueReceiveBean.java:43)
at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.AbstractMessageReceiveBean.onMessage(AbstractMessageReceiveBean.java:127)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:377)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:311)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:286)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2351)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2267)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210) -
Oracle.sql.BLOB and oracle.sql.STRUCT
I'm development a application in Java with oracle, to manage media files. When I try to insert into oracle , I have this problem "oracle.sql.BLOB cannot be cast to oracle.sql.STRUCT" , and I don't know what that can be ..
This is my code , please help with that.. If you have a smaple code of java and oracle to insert media , that will be a great help ..
public void loadDataFromStream(OracleConnection con)
try {
Statement s = con.createStatement();
OracleResultSet rs = (OracleResultSet)
s.executeQuery("select * from blobs where id='video2.avi' for update ");
String index = "";
while(rs.next())
index = rs.getString(1);
index+="1";
System.out.println("llego hasta aki");
// el error esta en esta linea de abajo ...
OrdVideo vidObj = (OrdVideo) rs.getCustomDatum(2, OrdVideo.getFactory());
//rs.getBfile(3);///
FileInputStream fStream = new FileInputStream("/home/jova/movie.avi");
vidObj.loadDataFromInputStream(fStream);
vidObj.getDataInFile("/home/jova/movie.avi");
fStream.close();
System.out.println(" getContentLength output : " +
vidObj.getContentLength());
OraclePreparedStatement stmt1 =
(OraclePreparedStatement) con.prepareCall("update blob_col set image = ? where id = " + index);
stmt1.setCustomDatum(1,vidObj);
stmt1.execute();
stmt1.close() ;
index+="1";
System.out.println("OK");
catch(Exception e) {
System.out.println("exception raised " + e);
System.out.println("load data from stream unsuccessful");
}I'm development a application in Java with oracle, to manage media files. When I try to insert into oracle , I have this problem "oracle.sql.BLOB cannot be cast to oracle.sql.STRUCT" , and I don't know what that can be ..
This is my code , please help with that.. If you have a smaple code of java and oracle to insert media , that will be a great help ..
public void loadDataFromStream(OracleConnection con)
try {
Statement s = con.createStatement();
OracleResultSet rs = (OracleResultSet)
s.executeQuery("select * from blobs where id='video2.avi' for update ");
String index = "";
while(rs.next())
index = rs.getString(1);
index+="1";
System.out.println("llego hasta aki");
// el error esta en esta linea de abajo ...
OrdVideo vidObj = (OrdVideo) rs.getCustomDatum(2, OrdVideo.getFactory());
//rs.getBfile(3);///
FileInputStream fStream = new FileInputStream("/home/jova/movie.avi");
vidObj.loadDataFromInputStream(fStream);
vidObj.getDataInFile("/home/jova/movie.avi");
fStream.close();
System.out.println(" getContentLength output : " +
vidObj.getContentLength());
OraclePreparedStatement stmt1 =
(OraclePreparedStatement) con.prepareCall("update blob_col set image = ? where id = " + index);
stmt1.setCustomDatum(1,vidObj);
stmt1.execute();
stmt1.close() ;
index+="1";
System.out.println("OK");
catch(Exception e) {
System.out.println("exception raised " + e);
System.out.println("load data from stream unsuccessful");
} -
Problem with Java EE 5 and derby
have a problem with the database connectivity in the examples of Java EE 5, I have the NETBEANS 5.5 with Sun Java System Application Server Platform Edition 9, and with the derby database.
I just try to run my application, but there is not connectivity with the database. I review all the configurations and step to follow to run the examples, and does not even work.
The server.log, show this:
[#|2006-11-12T17:12:20.781+0000|WARNING|sun-appserver-pe9.0|oracle.toplink.essentials.file:/C:/as9rrtutorial/jsstutorials/examples/web/bookstore2/build/web/WEB-INF/lib/bookstore.jar-book|_ThreadID=14;_ThreadName=httpWorkerThread-8080-0;_RequestID=4c2405ce-8492-4786-bff4-ef1332cfccd4;|
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.apache.derby.client.am.SqlException: Table 'WEB_BOOKSTORE_BOOKS' does not exist.Error Code: -1
Call:SELECT BOOKID, ONSALE, CALENDAR_YEAR, PRICE, TITLE, INVENTORY, DESCRIPTION, FIRSTNAME, SURNAME FROM WEB_BOOKSTORE_BOOKS WHERE (BOOKID = ?)
bind => [203]
Query:ReadObjectQuery(com.sun.bookstore.database.Book)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:213)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:199)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:620)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2152)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2127)
at oracle.toplink.essentials.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:350)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:709)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:894)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.findInternal(EntityManagerImpl.java:298)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.findInternal(EntityManagerImpl.java:274)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.find(EntityManagerImpl.java:130)
at com.sun.bookstore2.database.BookDBAO.getBook(BookDBAO.java:73)
at com.sun.bookstore2.database.BookDB.getBook(BookDB.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:273)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:982)
at org.apache.jsp.books.bookstore_jsp._jspService(bookstore_jsp.java:191)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:412)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:850)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:697)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:532)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:465)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:353)
at com.sun.bookstore2.dispatcher.Dispatcher.doGet(Dispatcher.java:106)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: org.apache.derby.client.am.SqlException: Table 'WEB_BOOKSTORE_BOOKS' does not exist.
at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
at com.sun.gjc.spi.ConnectionHolder.prepareStatement(ConnectionHolder.java:413)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1147)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:597)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:470)
... 69 more
|#]
And the table exist in the database.
Some body can help me?
Thanks.You probably made the same mistake as I did and added the tables manually to the "sample" database instead of the "sun-appserv-samples" database.
marc -
SQL PRO AND ORACLE SQL URGENT HELP
Can any one help me out here withe these questions:
Pro C Qusetions:
1. What are the SQLCA and SQLDA ?
2. What is a mutating table ?
3. What are indicator variables and how are they used ?
4. What are the components of the Oracle VARCHAR type and how should such a structure be loaded into a C Char type ?
5. Why would you use the ‘ALTER SESSION’ command in conjunction with the tkprof program and what is the purpose of each step ?
ORACLE SQL QUESTIONS:
1.0 How would you move data from one Oracle database to another Oracle database?
2.0 How would you import data into an Oracle database from another DBMS or flat file?
3.0 What is an Outer Join and how does the output differ from a simple join?
4.0 What is the difference between the conditional expressions IN and EXISTS ? In what circumstances would you USE EACH.
5.0 You cannot create a unique index on a table due to duplicate values. Describe how you find the offending row and subsequently delete it.1. What are the SQLCA and SQLDA ?
SQLCA = SQL Communications area: stores status variable and error message text. manual reference
SQLDA = SQL Descriptor Area - stores information about bind variables. manual reference
2. What is a mutating table ?
A table that is being modified and that you are trying to select from. Usually encountered in a before insert/update trigger when trying to select from the table that is being inserted/updated, which causes the dreaded ORA-04091 error.
3. What are indicator variables and how are they used ?
Used in Pro*C to tell if the table column contains the value NULL.
4. What are the components of the Oracle VARCHAR type and how should such a structure be loaded into a C Char type ?
varchar2 is a null-terminated string. Use Pro*C extended type VARCHAR. Manual Reference
5. Why would you use the "ALTER SESSION" command in conjunction with the tkprof program and what is the purpose of each step ?
Use alter session to set tracing on for your session:
alter session set sql_trace = true ;
this will create a trace file in the user dump destination
(select value from v$parameter where name = 'user_dump_dest'). Use tkprof to format the trace file.
1.0 How would you move data from one Oracle database to another Oracle database?
Export / Import Oracle utility, Database link and INSERT ... SELECT ..., Database link and COPY command, save to flat file and use SQL*Loader, transportable tablespaces, database "cloning" by copying database files over to a new server and creating a new instance based on those files. List of manuals look up CREATE DATABASE LINK in the SQL Reference, COPY command in the SQL*Plus reference, Export/Import or SQL*Loader in the Utilities manual.
2.0 How would you import data into an Oracle database from another DBMS or flat file?
SQL*Loader Oracle Utility
3.0 What is an Outer Join and how does the output differ from a simple join?
An example is worth 1000 words.
SQL> select * from emp ;
EMP_NO EMP_NAME DEPT_NO
1 SMITH 1
2 JONES 1
3 BROWN 2
4 BOND 5
SQL> select * from dept ;
DEPT_NO DEPT_NAME
1 SALES
2 MARKETING
SQL> -- inner or "ordinary" join
SQL> select a.emp_name, b.dept_name
2 from emp a, dept b
3 where a.dept_no = b.dept_no ;
EMP_NAME DEPT_NAME
SMITH SALES
JONES SALES
BROWN MARKETING
SQL> -- outer join
SQL> select a.emp_name, b.dept_name
2 from emp a, dept b
3 where a.dept_no = b.dept_no (+) ;
EMP_NAME DEPT_NAME
SMITH SALES
JONES SALES
BROWN MARKETING
BOND5.0 You cannot create a unique index on a table due to duplicate values. Describe how you find the offending row and subsequently delete it.
Using exceptions clause of enable constraint
ALTER TABLE employees
ENABLE VALIDATE CONSTRAINT emp_manager_fk
EXCEPTIONS INTO exceptions ;
Find rowids in exceptions table and use those rowids to delete the "bad" data. See SQL reference on alter table for more details. -
Problem with Java Studio Creator and Tomcat Server
Hi Gays ,
I have problem:
here is the error from tomcat 5
com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: statement handle not executed: getMetaData
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java: 601)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.ja va:316)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87 )
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
if i develop application on my pc ( java studio creator with sun apps bundlled) is working perfectly,
but i migrated application to Tomcat Server ( Database the same - Oracle 10 g)
i can't show value ( as text) from datasoruce ( is in SessionBean1)
(Category-.>Subcat->Items->details( url from items table[items.jsp])
this is a working url "/faces/testpage.jsp?auk_id=31 "
( working with sun apps server , but not on Tomcat 5)
below prerender method in details.java and fragment of details.jsp
public void prerender() {
try {
String idauk = (getExternalContext().getRequestParameterMap().get("auk_id").toString());
System.out.println("wartosc auk_id " + idauk);
if (idauk != null) {
getSessionBean1().getDetailsRowSet().setObject(1,idauk);
getSessionBean1().getDetailsDataProvider().refresh();
details.jsp
xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page binding="#{testpage.page1}" id="page1">
<ui:html binding="#{testpage.html1}" id="html1">
<ui:head binding="#{testpage.head1}" id="head1">
<ui:link binding="#{testpage.link1}" id="link1" url="/resources/stylesheet.css"/>
</ui:head>
<ui:body binding="#{testpage.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{testpage.form1}" id="form1">
<ui:staticText binding="#{testpage.staticText1}" id="staticText1" style="position: absolute; left: 120px; top: 96px" text="#{SessionBean1.testDataProvider.value['Name']}"/>
</ui:form>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>
Help People ! Any Ideas I'm stuck, why is working with Sun Servet but not with Tomcat and only just thing ?
Thanks in advance for helping me to resolve the night problem :)Hi I found solution, i puted on the page a table -component (with brand new automaticly created dataprovider) , then i set properties visible= false for table, and now I can bind statictext with database field and deploy on tomcat server .
But i think it is not a elegant solution in page source i habe noused-code.
Have Any another Ideas. HELP PEOPLE !!!!
Mariuszek: I use Creator.because right now I can see result of my job and i can qickly change ideas ,
I tried with JDeveleper but i did'nt find this functionality (wich version do you prefered ?) , unfortunately i have to deploy my application on Tomcat. This is my study project, and i make this to become a Master of Techinal Univeristy ;), Deadline time is 30 th September :(
greetings -
Problems with file location variables and Oracle 9i
I'm new to Oracle and I'm seeing if I can get Oracle 9i running and do anything useful for me on a Solaris 9 platform.
The installation of Oracle went OK except step three, creating a starter database. The installation wanted to put it on the same file system as {ORACLE_HOME} although I told the installation that I wanted {ORACLE_BASE} on another file system. So of course there wasn't enough room on the file system to make the starter database.
I thought I'd be able to correct this after installation. I tried to make a General Purpose Database with Database Configuration Assistant but DBCA in step 5 of 7, File Location Variables still shows {ORACLE_BASE} to be the same as {ORACLE_HOME}, and no way to change that variable on this screen. Don't I want to change { ORACLE_BASE} to a file system that has enough space to make the data base? How do I change this variable? When logged in as the oracle user, I don't see it listed by setenv.
When I ignored this setting and tried to finish DBCA, it hung.I looked for the {ORACLE*} environmental variables in the profile and login files of my oracle user, but didn't find that they were added by my Oracle setup. So I didn't think defining them as environmental variables would persist or overrule the global variables set at dbca run time.
In the dbca windows, step 5 displays these global variable settings provocatively in a table, as if Oracle wants me to verify and edit them if necessary, but I keep poking at them with right mouse clicks, left mouse clicks, backspace, and delete, but all I can do is turn them blue.
Currently when I use dbca to try to create a general purpose database, it hangs at 50% done, but not much space is used up on {ORACLE_HOME}. So it doesn't really look like the hang is caused by the disk being full. One of the processes that is hung is jre, so I thought I'd review the Oracle requirements and locations for JRE on my system. -
Problem with Java-based application and WebVPN
Hello. Could you please help me in find out any specification/known limitations in using Java-based applications through WebVPN in Cisco ASA 5520 v8.3(2).
A customer of mine has got in trouble in using a Java viewer for graphical files that is invoked by another application (this one correctly served via WebVPN), that cannot be launched because JVM does not find it (NullPointer).
Our suspects are generically about the URL rewriting of the WebVPN and/or unsupported configuration in the ASA SSL certificates vs Java.
Any hint about where to search or what to try?
Thanks.Hello. Could you please help me in find out any specification/known limitations in using Java-based applications through WebVPN in Cisco ASA 5520 v8.3(2).
A customer of mine has got in trouble in using a Java viewer for graphical files that is invoked by another application (this one correctly served via WebVPN), that cannot be launched because JVM does not find it (NullPointer).
Our suspects are generically about the URL rewriting of the WebVPN and/or unsupported configuration in the ASA SSL certificates vs Java.
Any hint about where to search or what to try?
Thanks. -
Compare SQL Server and Oracle syntax
Hello, I am very new to the Oracle DB as I have been working with MS SQL Server for many years. I have a SQL statement that works fine in MSSQL but seems to not work in Oracle. Is this a syntax problem or do I need to look elsewhere?
DECLARE @as_master_key varchar(26)
EXEC [dbo].[GET_UNIQUE_MASTER_KEY]
@as_project_name = N'CMDEMO',
@as_database_site = N'CMPL',
@as_user_initials = N'SK',
@as_table = N'SUBMITTAL_CATEGORY',
@as_master_key =
@as_master_key
OUTPUT SELECT @as_master_key as N'master_key'
This is what I use in MSSQL and it works fine - but I am porting this application to an Oracle backend and it fails. Any suggestions?
Thanks in advance to this newbie. :)SQL Server and Oracle are two completely different RDBMS'.
You'd be best not to try and port SQL Server code to Oracle SQL or PL/SQL directly as it will not favour the power of Oracle's features correctly.
I'm not sure what your code is supposed to be doing (I find SQL Server code awful to read, and never understand the need for "@" before variable names, that just seems to show a lazy parser (or lazy coder who designed the parser)).
From what I can guess it's going to be something like...
SQL code...
create or replace sequence my_master_key;PL/SQL code...
DECLARE
as_master_key number;
as_project_name varchar2(20) := 'CMDEMO';
as_database_site varchar2(20) := 'CMPL';
as_user_initials varckar2(5) := 'SK';
as_table varchar2(30) := 'SUBMITTAL_CATEGORY';
BEGIN
select my_master_key.nextval
into as_master_key
from dual;
-- In 11g you could replace this select with just:
-- as_master_key = my_master_key.nextval;
END;This get's a unique sequence value into a variable and declares all the other variables. What you want to do with them after that I don't know. -
I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
Please Advice!
Thanks in advance
AnuPamaHi Anupama,
First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
These are a few simple things that you should do in your JDBC program:
1. Import the necessary JDBC classes in your programs that use JDBC.
For example:
import java.sql.*;
import java.math.*;
2. Register the Oracle driver before before calling other JDBC APIs.
(This is not needed if you are using the JDBC Server-side Internal
Driver because registration is done automatically in the server.)
To register the Oracle driver, make sure the following statement
is executed at least once in your Java session:
DriverManager.registerDriver(
new oracle.jdbc.driver.OracleDriver());
3. Open a connection to the database with the getConnection call.
Different connection URLs should be used for different JDBC
drivers. The following examples demonstrate the different URLs.
For the JDBC OCI8 Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:oci8:@<database>",
"scott", "tiger");
where <database> is either an entry in tnsnames.ora or a SQL*net
name-value pair.
For the JDBC Thin Driver, or Server-side Thin Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@<database>",
"scott", "tiger");
where <database> is either a string of the form
<host>:<port>:<sid> or a SQL*net name-value pair.
For the JDBC Server-side Internal Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:kprb:");
Note that the trailing ':' character is necessary. When you use
the Server-side Internal Driver, you always connect to the
database you are executing in. You can also do this:
Connection conn
= new oracle.jdbc.driver.OracleDriver().defaultConnection();
Hope this helps,
Thanks,
Anupama wrote:
I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
Please Advice!
Thanks in advance
AnuPama--
Apurb Kumar -
Discussion Forum Portlet - Problems with JAVA and UTF8?
Hi
I installed the Discussion Forum Portlet successfully. It also seems that almost everything works fine. There's only a problem if I have new posts that include special German characters (Umlaute) like ä, ö, ü or special French characters like é, è or ç. They are saved correctly in the table but if you view the post the characters are not displayed correctly.
Example
input: ça va?
result: ça va?
I know that there are problems with Java and UTF8 Database. Is there a possibility to change this (bug)?
Regards
MarkHere's what I got. I don't see anything that helps but I'm kinda new to using SQL and java together.
D:\javatemp\viddb>java videodb
Problem with SQL java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver
] Syntax error in CREATE TABLE statement.
Driver Error Number-3551
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
CREATE TABLE statement.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
at videodb.main(videodb.java:31)
D:\javatemp\viddb> -
Problem with java and pogo games
i use mozilla and now with the problems with java and hackers cannot play my pogo games,what can i do? i disabled my java i tried java 6 doesnt work or is not safe,what is a safe way to play games on pogo that use java?
Oracle has released a Java 7 Update 11 to address security vulnerabilities and you should update to that version.
*https://support.mozilla.org/kb/how-to-use-java-if-its-been-blocked
See also:
*http://kb.mozillazine.org/Java#Windows_installation_issues
You can find the latest Java version on the Oracle website.
See Java Platform > Java SE 7U11 and Java 6U38 (Download JRE)
*http://www.oracle.com/technetwork/java/javase/downloads/index.html -
Hello,
I use Entity Framework code first approach.
My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
But, Is this possible to access SQL Server and Oracle in the same project.
Thanks,
MuruganThis should be possible with a Code-First workflow. In Code-First the database mapping layer is generated at runtime.
David
David http://blogs.msdn.com/b/dbrowne/ -
NVARCHAR - NVARCHAR2 datatype mapping between sql server and oracle.
Question regarding size allocation that occurs for NVARCHAR columns in sql server to NVARCHAR2 in Oracle in the migration tool.
The migration tool has converted NVARCHAR columns to be twice their size as NVARCH2 in Oracle. Example, a table whose column is mycol NVARCHAR(40) gets migrated as mycol NVARCHAR2(80).
In SQL Server land, the designation of a column as NVARCHAR(40) will physically store the column as 80 bytes. However, as I understand from this excerpt (taken from here: http://www.oracle.com/technology/oramag/oracle/03-nov/o63tech_glob.html), that Oracle in essence will do the same thing for NVARCHAR2:
To make it easy to allocate proper storage for Unicode values, Oracle9i Database introduced character semantics. You can now use a declaration such as VARCHAR2(3 CHAR), and Oracle will set aside the correct number of bytes to accommodate three characters in the underlying character set. In the case of AL32UTF8, Oracle will allocate 12 bytes, because the maximum length of a UTF-8 character encoding is four bytes (3 characters * 4 bytes/character = 12 bytes). On the other hand, if you're using AL16UTF16, in which case your declaration would be NVARCHAR2(3), Oracle allocates just six bytes (3 characters * 2 bytes/character = 6 bytes). One difference worth noting is that for UTF-8, a declaration using character semantics allows enough room for surrogate characters, whereas for UTF-16 that is not the case. A declaration such as NVARCHAR2(3) provides room for three UTF-16 code units, but a single supplementary character may consume two of those code units.
As I read this, NVARCHAR(40) in sql server should be equivalent to NVARCHAR2(40) in Oracle and not NVARCHAR2(80) as it gets translated to - am I missing something? We have a rather large database to migrate so I need to get this size allocation right (and I obviously don't want to truncate any data).
Thanks -Right - well, that's what I'm suggesting is that NVARCHAR(8) in SQL Server is equivalent to NVARCHAR2(8) in Oracle. Truncation will occur after 8 of any character, including, say, double byte Kanjii characters, which would physically store 16 bytes in the NVARCHAR(8) NVARCHAR2(8) column defn. I tried that in both SQL Server and Oracle, and the behavior is the same.
Also, technically, NVARCHAR2(8) and VARCHAR2(8 CHAR) is roughly the same in terms of behavior, except that in the first case, the physical storage is 16 bytes, while in the second case, it's 24 bytes (to account for 'supplemental' characters or true UTF-8 compliance). Same truncation occurs after 8 of -any- character be it single byte ascii or double byte kanjii, which is the behavior I expect.
Thanks for looking into this. What I decided to do was the following:
What was originally defined in SQL Server as varchar (and translated to VARCHAR2 with the CHAR designation), I removed the CHAR designation since I truly want that number of bytes to be stored, and not characters (for columns I do not care about UTF8 or 16 compliance - that will also mimic the same behavior I currently have on the SQL Server side. For anything that was nvarchar in SQL Server, I went ahead and created them as VARCHAR2 with the CHAR designation, with the same size (not double the value as was in SQL Server which the documentation says it gets translated to). I did this since we probably will need true UTF-8 compliance down the line, and since I had the hood open, it was easy enough to do. I could also have converted NVARCHAR(n) to NVARCHAR2(n) (and not n*2) as what was happening in the migration.
I tested strings in both cases, and I think I have my solution.
Edited by: kpw on Sep 24, 2008 11:21 AM
Maybe you are looking for
-
LSMW MM02 - CHANGE PURCHASE ORDER TEXT
I need to change the purchase order text in mm02 using the LSMW. Can you help me?
-
IDES ERP 2005 / open ABAP dictionary conversion during SPAM Update
Dear all, First of all, I'm currently busy implementing a educational enviroment for our company, we are using IDES MySAP ERP 2005 SR1 MSSQL. At the moment we are trying to upgrade the SPAM version from version 20 to 22. However, during the requireme
-
How to use tag libraries?
hi, I have an external taglibrary file, bean.tld. I want to use the tags of this file in portal component. Where shall i place this file in order to access it? regards, ganesh natarajan
-
Ipad mini manual network selection during roaming
I am currently on roaming in Kuala lumpur. the ipad says "unable to load networks" when i select manual in carrier. Any solutions ?
-
Just bought photoshop cc but still can't access it?
My free trial of Photoshop CC expired around a week ago, and tonight I bought the Creative Cloud Photography plan (1 year prepaid). However, when I go to open up Photoshop it still just opens up Adobe Application Manager and tells me my trial has exp