Using CachedRowSet with sybase JDBC driver
Hello,
Does anyone know if there is any way to use CachedRowSet with sybase JDBC
driver?
I knew there was posting regarding this in the year 2000. And now it 2003. Thanks!
Peter
Peter Wu wrote:
Hello,
Does anyone know if there is any way to use CachedRowSet with sybase JDBC
driver?
I knew there was posting regarding this in the year 2000. And now it 2003. Thanks!
PeterYes there is, but it involves some driver-specific properties, and I know this from
a discussion I read on their jdbc support newsgroup. That would be the best place
for an answer about their driver. Try news://forums.sybase.com, in the sybase.public.jconnect50
group.
Joe
Similar Messages
-
CachedRowSet with sybase JDBC driver
In previous postings you mentioned the solution to using CachedRowSets with Sybase
JDBC involves setting certain properties. My question is WHERE and WHEN do you
set these properties?Peter Wu wrote:
Hello,
Does anyone know if there is any way to use CachedRowSet with sybase JDBC
driver?
I knew there was posting regarding this in the year 2000. And now it 2003. Thanks!
PeterYes there is, but it involves some driver-specific properties, and I know this from
a discussion I read on their jdbc support newsgroup. That would be the best place
for an answer about their driver. Try news://forums.sybase.com, in the sybase.public.jconnect50
group.
Joe -
Issues while configuring java application using JDO with MS JDBC Driver 1.0
We are in the process of configuring our java application with the production version of SQL Server 2005 Java Database Connectivity (JDBC) Driver 1.0. We are facing issues getting it to work with Sun App Server using JDO concept.
After creating the data store, adding the JDBC driver to the application server classpath through console and also copying the driver into the lib directory, we are still getting the below error.
Following is the stack trace encountered while running the application
[#|2006-02-15T10:21:25.493+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=30;|JDO74010: Bean 'InventoryEJB' method ejbFindAllInventoryItems: problems running JDOQL query.
com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
NestedException: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:870)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681)
at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.jdoGetPersistenceManager(InventoryEJB1142755294_ConcreteImpl.java:530)
at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.ejbFindAllInventoryItems(InventoryEJB1142755294_ConcreteImpl.java:146)
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 com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:185)
at $Proxy164.findAllInventoryItems(Unknown Source)
at com.sun.j2ee.blueprints.supplier.inventory.web.DisplayInventoryBean.getInventory(Unknown Source)
at org.apache.jsp.displayinventory_jsp._jspService(displayinventory_jsp.java:119)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
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 org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
at com.sun.j2ee.blueprints.supplier.inventory.web.RcvrRequestProcessor.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
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 org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
Can anyone help me on this issue?
Regards,
BinduI have already tried this before and this not work too, but strange that even if I use JDBC:ODBC bridge driver, the return value for output parameters are not correct, that is, only return the value that I input but not the value after executed in the procedure....
The code that I used with JDBC:ODBC bridge is as follow:
public static void main(String[] args) {
String url = "jdbc:odbc:;DRIVER=SQL Server;Persist Security Info=False;database=db;Server=sql;uid=sa;pwd=pwd";
Connection con;
ResultSet rs = null;
CallableStatement callS = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
con=DriverManager.getConnection(url);
callS = con.prepareCall("{ call dbo.CpJavaTest (?)}");
callS.registerOutParameter(1, Types.INTEGER);
callS.execute();
rs=callS.getResultSet();
int ret = callS.getInt(1);
System.out.println("return value : " + ret);
while (rs.next()) {
String f1 = rs.getString(4);
String f2 = rs.getString(5);
System.out.println(f1 + " " + f2);
} catch(SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
The value of the output parameter is same as what I inputed! Hope any one can teach me how to correct it...
Thank you very much! -
Using PVCs with the ATM driver
I am using using Solaris 8 with SunATM 5.0 installed.
I've written a program that uses atm_open and atm_add_vpci
When i run this program as a normal user the atm_add_vpci call returns with the error ENOTOWNER
When i run this program as root everything works fine.
I want to run this program as a normal user.
Can anyone tell me how I can do this?
(the program is does the same as the program 'raw -I 500' from the /opt/SUNWconn/atm/examples directoryPeter Wu wrote:
Hello,
Does anyone know if there is any way to use CachedRowSet with sybase JDBC
driver?
I knew there was posting regarding this in the year 2000. And now it 2003. Thanks!
PeterYes there is, but it involves some driver-specific properties, and I know this from
a discussion I read on their jdbc support newsgroup. That would be the best place
for an answer about their driver. Try news://forums.sybase.com, in the sybase.public.jconnect50
group.
Joe -
Beginner Has Problem With Loading JDBC Driver Using MySQL
Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
sql> select * from videos
2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
4. MySQL server is running
C:\> C:\mysql\bin\mysqld-nt --standalone
5. open another DOS window and use the database
mysql>USE SOUP
6. succesfully compiled a Java program (javac Test.java):
import java.sql.* ;
public class Test
public static void main( String[] args )
try
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
try
Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
try
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
while ( rs.next() )
System.out.println( rs.getString( "TITLE" ) );
rs.close();
statement.close();
catch ( SQLException e )
System.out.println( "JDBC error: " + e );
finally
con.close();
catch( SQLException e )
System.out.println( "could not get JDBC connection: " + e );
catch( Exception e )
System.out.println( "could not load JDBC driver: " + e );
7. when I run the Java program (java Test), I got
the message:
could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
What am I missing?Hi,
I missed to specify test in my last post.
Try running your program by explicitly setting the classspath when
running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
Make sure your jar file contains org.gjt.mm.mysql.Driver class -
Sybase JDBC driver & Invalid column name error
I submitted a note a year ago concerning JDBC-ODBC bridge and SQL Server db. Same Invalid column name error. The resolution was a bug in the XSU code.
This time the error is with a jconnect5 JDBC driver from Sybase to a Sybase ASA db. ASA is Adaptive Server Anywhere.
<ERROR xsql-timing="140">oracle.xml.sql.OracleXMLSQLException: S0022: Invalid column name 'name'.</ERROR>
However if I use a Sybase JDBC driver from INet Software of Germany, I get the desired result of my query.
Below are sample XSQLConfig.xml definitions.
INet Software Sybase JDBC driver definition:
- <connection name="deasa">
<username>dba</username>
<password>sql</password>
<dburl>jdbc:inetsyb:LEMKAU:2638?database=asademo</dburl>
<driver>com.inet.syb.SybDriver</driver>
<autocommit>true</autocommit>
</connection>
Sybase jconnect5 Sybase JDBC driver definition:
- <connection name="asa">
<username>dba</username>
<password>sql</password>
<dburl>jdbc:sybase:Tds:lemkau:2638?ServiceName=asademo</dburl>
<driver>com.sybase.jdbc.SybDriver</driver>
<autocommit>true</autocommit>
</connection>
I believe the bug has to do with the numeric codes that the drivers use to determine data types are not properly interpreted.
See XML General note title "insert-request, xsu 2.1.0 beta & SQL Server" for reference.
Steve.Thanks for the notification. We will look into this issue...
-
[Sybase JDBC Driver]Object has been closed
Hi,
I am getting the following error when accessing a datasource in an EJB on Weblogic using the Data Direct Drivers.
java.sql.SQLException: [DataDirect][Sybase JDBC Driver]Object has been closed.
The code works every other time. the first time through it works the second time I get the error.
Any insite would be appricated.
Here is my code
public String test(String id)
System.out.println ("test1");
DataSource ds = null;
Connection conn = null;
PreparedStatement stmt = null;
PreparedStatement stmt2 = null;
String ret = "?????";
try
System.out.println ("read data - prepare");
InitialContext ic = new InitialContext();
ds = (DataSource)ic.lookup("java:comp/env/jdbc/dataconn");
conn = ds.getConnection();
String sql = "SELECT * FROM myTable WHERE ID = ?";
System.out.println ("read data - conn.prepareStatement(sql);");
stmt = conn.prepareStatement(sql);
stmt.setString(1, id);
// stmt.setMaxRows(1000);
System.out.println ("read data - stmt.executeQuery();");
ResultSet rs = stmt.executeQuery();
System.out.println ("read data - read");
if(!rs.next())
ret = "Not found";
else
ret = "found";
sql = "UPDATE myTable SET column1 = column1 + 1 WHERE ID = ?";
System.out.println ("update data - prepare");
stmt2 = conn.prepareStatement(sql);
stmt2.setString(1, id);
ret = ret + stmt2.executeUpdate();
System.out.println ("update data - update");
catch(Exception e)
e.printStackTrace();
finally
try
stmt.close();
catch(Exception exception1) { }
try
stmt2.close();
catch(Exception exception1) { }
try
conn.close();
catch(Exception exception1) { }
stmt = null;
stmt2 = null;
conn = null;
return ret;
}Hi. What version of weblogic, and can you print the whole stacktrace?
That way I'll know which object is already closed. This hints at an
already-fixed bug, but I'm not sure yet... And tell me what happens
if you close your result set after you do your call to next(). Lastly,
you can save some DBMS traffic if you change the query to:
"SELECT 1 FROM myTable WHERE ID = ?"
Then regardless of how wide the table is, and whether the table data
is in DBMS memory, as long as there's an index on ID, the query only
needs to use the index, not the data page to answer. If there's an
index entry for your ID value, you'll get one row with 1 in it, else
nothing.
thanks
Joe
Scot McReynolds wrote:
Hi,
I am getting the following error when accessing a datasource in an EJB on Weblogic using the Data Direct Drivers.
java.sql.SQLException: [DataDirect][Sybase JDBC Driver]Object has been closed.
The code works every other time. the first time through it works the second time I get the error.
Any insite would be appricated.
Here is my code
public String test(String id)
System.out.println ("test1");
DataSource ds = null;
Connection conn = null;
PreparedStatement stmt = null;
PreparedStatement stmt2 = null;
String ret = "?????";
try
System.out.println ("read data - prepare");
InitialContext ic = new InitialContext();
ds = (DataSource)ic.lookup("java:comp/env/jdbc/dataconn");
conn = ds.getConnection();
String sql = "SELECT * FROM myTable WHERE ID = ?";
System.out.println ("read data - conn.prepareStatement(sql);");
stmt = conn.prepareStatement(sql);
stmt.setString(1, id);
// stmt.setMaxRows(1000);
System.out.println ("read data - stmt.executeQuery();");
ResultSet rs = stmt.executeQuery();
System.out.println ("read data - read");
if(!rs.next())
ret = "Not found";
else
ret = "found";
sql = "UPDATE myTable SET column1 = column1 + 1 WHERE ID = ?";
System.out.println ("update data - prepare");
stmt2 = conn.prepareStatement(sql);
stmt2.setString(1, id);
ret = ret + stmt2.executeUpdate();
System.out.println ("update data - update");
catch(Exception e)
e.printStackTrace();
finally
try
stmt.close();
catch(Exception exception1) { }
try
stmt2.close();
catch(Exception exception1) { }
try
conn.close();
catch(Exception exception1) { }
stmt = null;
stmt2 = null;
conn = null;
return ret; -
Character encoding and Sybase JDBC driver
Hi,
I have an issue with the Sybase JDBC driver we are using. We have characters in our database, e.g., canon with a ~ over the n. When I do a getString from the ResultSet, I see a ? instead of the character. I'm specifying utf8 as the encoding in the properties in the WLS console. I tried utf16 or ucs2, but I got exceptions from the Sybase JDBC driver at start up.
Any help would be greatly appreciated.Pat Bumpus wrote:
Hi,
I have an issue with the Sybase JDBC driver we are using. We have characters in our database, e.g., canon with a ~ over the n. When I do a getString from the ResultSet, I see a ? instead of the character. I'm specifying utf8 as the encoding in the properties in the WLS console. I tried utf16 or ucs2, but I got exceptions from the Sybase JDBC driver at start up.
Any help would be greatly appreciated.Which Sybase driver are you using?
Joe -
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
Hi,
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
This link here indicates this was fixed awhile ago:
http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
And, the thread seems to stay around even after the query has finished executing.
Can anyone confirm whether this is actually fixed?
Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
Thanks!Hi,
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
This link here indicates this was fixed awhile ago:
http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
And, the thread seems to stay around even after the query has finished executing.
Can anyone confirm whether this is actually fixed?
Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
Thanks! -
Can I use 8.1.7 jdbc driver to connect 8.1.6 database?
I want to develop a J2EE application. but now I only have 8.1.6 database on hand. Can I use 8.1.7 jdbc driver instead of 8.1.6 driver to implement ConnectionPool feature?
I am in the same situation...we are currently on Oracle 8.1.6 using a Jdbc 2.0 driver, but would like to go ahead with using an Oracle Jdbc 3.0 driver ...
-
Problem using MS SQL Server JDBC Driver
I am trying to use MS SQL Server JBDC driver with JDeveloper9i. I followed the steps mentioned in the document
http://otn.oracle.com/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html
Still I am getting the following error message
Error initializing data-source 'SQLTestDS': DriverManagerDataSource driver 'com.microsoft.jdbc.sqlserver.SQLServerDriver' not found
What could be the reason?Did anybody run into similar issue?
Thanks in advance.
RCI assume from your message that you are attempting to
deploy your application into OC4J - you're probably
implicitly using the inbuilt OC4J if your using JSPs.
If so, try placing the jdbc jars into the <JDEVHOME>\lib directory
and referencing them from the j2ee\home\application.xml
file:
use lines like:
<library path="../../../lib/msbase.jar" />
regards, Karl -
Hi,
We have recently upgraded our weblogic server from 6.0 to 6.1 sp5 on our testing
environment.
Our application runs fine for a few hours until our sybase db shuts down for some
reason. Thus rendering all connections to the db to fail.
Anyone know if the current JDBC driver has any comptiability issues with weblogic
6.1 sp5. Current version is "jConnect (TM) for JDBC(TM)/5.2(Build 21136)/P/EBF9747/JDK12/"
Our application connects to the db via a connection pool.
Here's the current settings for the connection pool:
<JDBCConnectionPool CapacityIncrement="10"
DriverName="com.sybase.jdbc2.jdbc.SybDriver" InitialCapacity="1"
MaxCapacity="200" Name="biaSybaseConnectionPool"
Properties="user=XXXXX;password=XXXXX" RefreshMinutes="0"
ShrinkPeriodMinutes="10" ShrinkingEnabled="true" Targets="as1"
TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
TestTableName="systypes" URL="jdbc:sybase:Tds:x.x.x.x:xxxx"/>
Here's some error log from weblgoic:
java.sql.SQLException: weblogic.common.ConnectDeadException: failed to make new
pool connection: java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings
chained to this exception for the reason(s).
weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to
this exception for the reason(s).
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:480)
at com.sybase.jdbc2.tds.Tds.processLoginAckToken(Tds.java:2938)
at com.sybase.jdbc2.tds.Tds.doLogin(Tds.java:419)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:341)
Thanks for your help
Regards,
RaymondR Fung wrote:
Hi,
We have recently upgraded our weblogic server from 6.0 to 6.1 sp5 on our testing
environment.
Our application runs fine for a few hours until our sybase db shuts down for some
reason. Thus rendering all connections to the db to fail.
Anyone know if the current JDBC driver has any comptiability issues with weblogic
6.1 sp5. Current version is "jConnect (TM) for JDBC(TM)/5.2(Build 21136)/P/EBF9747/JDK12/"
Our application connects to the db via a connection pool.
Here's the current settings for the connection pool:
<JDBCConnectionPool CapacityIncrement="10"
DriverName="com.sybase.jdbc2.jdbc.SybDriver" InitialCapacity="1"
MaxCapacity="200" Name="biaSybaseConnectionPool"
Properties="user=XXXXX;password=XXXXX" RefreshMinutes="0"
ShrinkPeriodMinutes="10" ShrinkingEnabled="true" Targets="as1"
TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
TestTableName="systypes" URL="jdbc:sybase:Tds:x.x.x.x:xxxx"/>Hi. A few things: I would set the initial capacity = max capacity = 50 or less.
I would set TestConnectionsOnRelease="false".
See below for more....
Here's some error log from weblgoic:
java.sql.SQLException: weblogic.common.ConnectDeadException: failed to make new
pool connection: java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings
chained to this exception for the reason(s).
*******************************************I would expect to see this sort of exception in the logs during the time the DBMS was
down. Are you saying that the pool never recovers after the DBMS comes back up?
Lastly, I recommend that you download Sybase's latest appropriate driver and get it ahead
of weblogic stuff in the classpath the statup script builds for the server.
Joe
>
weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to
this exception for the reason(s).
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:480)
at com.sybase.jdbc2.tds.Tds.processLoginAckToken(Tds.java:2938)
at com.sybase.jdbc2.tds.Tds.doLogin(Tds.java:419)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:341)
Thanks for your help
Regards,
Raymond -
CLassCastException with oracle.jdbc.driver.OracleCallableStatement
Hello,
I get a ClassCastException when I try to execute a Stored Procedure with WL6.1
and the JDriver.
I have a servlet who intanciate a Bean and call to his execute() method in this
way:
Context ctx = null;
Hashtable ht = new Hashtable();
Connection conn = null;
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
conn = ds.getConnection();
conn.setAutoCommit(true);
SvcEmpEstObt empEstObt = new SvcEmpEstObt();
empEstObt.setMaxRows(100);
empEstObt.setConnection(conn);
//Get parameters from Http Get and set the JB
empEstObt.setEmpRut(request.getParameter("rut"));
empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
//Execute Service
empEstObt.execute();
/* ********* the execute() method of the jb is listed here */
public int execute() throws ClassNotFoundException, SQLException{
intreturnedRows = 0;
try {if (connection == null){
try {Class.forName(driver);
} catch (ClassNotFoundException e) {
System.err.println("ClassNotFoundException: " + e);
throw e;
connection = DriverManager.getConnection(url, user, password);
row = -1;
srv_message = String.valueOf(maxRows);
String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
oracle.jdbc.driver.OracleCallableStatement procout = (oracle.jdbc.driver.OracleCallableStatement)
connection.prepareCall(sp); // The exception is here
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType, elemMaxLen);
// execute the call
procout.execute();
sqlWarning = procout.getWarnings();
srv_message = procout.getString(1);
returnStatus = new Integer(srv_message.substring(0,1)).intValue();
dagMessage = new DagMessage();
dagMessage.oracleMessage(srv_message);
// access the value using JDBC default mapping
empEstTitulo = procout.getString(4);
empEstUniv = procout.getString(5);
empEstNivel = procout.getInt(6);
curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
curNombre = (String[]) procout.getPlsqlIndexTable(8);
curFecha = (String[]) procout.getPlsqlIndexTable(9);
curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
// close the statement
procout.close();
if (curCodigo == null) {
return 0;
} else {
return curCodigo.length;
} catch (SQLException e) {
SQLException ex = e;
System.err.println("\n--- SQLException caught ---\n");
while (ex != null) {
System.err.println("Message: " + ex.getMessage ());
System.err.println("SQLState: " + ex.getSQLState ());
System.err.println("ErrorCode: " + ex.getErrorCode ());
ex = ex.getNextException();
System.out.println("");
throw e;
Does Someone has an idea why it happens ?Hans,
Could you give us the whole text of exception?
Regards,
Slava Imeshev
"Hans" <[email protected]> wrote in message
news:[email protected]...
>
It Works! Thanx a lot ....
I was working with a previous version of my App ... I fixed the problemand now
i can Cast to weblogic.jdbc.vendor.oracle.OracleCallableStatement,
But ...
I get the following Exception:
SQL Exception:
registerIndexTableOutParameter is not supported by the
underlying JDBC driver weblogic.jdbc.pool.Connection
What I need to do ?
/* this is what i`m trying to make */
weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
connection.prepareCall(sp);
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
>
>
"Hans" <[email protected]> wrote:
Thanx Slava,
But I have the same problem again...
I replace oracle.jdbc.driver.OracleCallableStatement with
weblogic.jdbc.vendor.oracle.OracleCallableStatement
and I get the same ClassClastException in
weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =
(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
connection.prepareCall(sp);
Any ideas ??
"Slava Imeshev" <[email protected]> wrote:
Hi Hans,
You can not cast returned object to
oracle.jdbc.driver.OracleCallableStatement
when accessing oracle db via connection pool.
It can be casted to weblogic.jdbc.vendor.oracle.OracleCallableStatement.
Here is a list of methods supported by this interface:
void clearParameters() throws java.sql.SQLException;
void registerIndexTableOutParameter(int i, int j, int k, int l) throws
java.sql.SQLException;
void registerOutParameter(int i, int j, int k, int l) throws
java.sql.SQLException;
java.sql.ResultSet getCursor(int i) throws java.sql.SQLException;
java.io.InputStream getAsciiStream(int i) throws
java.sql.SQLException;
java.io.InputStream getBinaryStream(int i) throwsjava.sql.SQLException;
java.io.InputStream getUnicodeStream(int i) throwsjava.sql.SQLException;
>>>
Regards,
Slava Imeshev
"Hans" <[email protected]> wrote in message
news:[email protected]...
Hello,
I get a ClassCastException when I try to execute a Stored Procedurewith
WL6.1
and the JDriver.
I have a servlet who intanciate a Bean and call to his execute()
method
in
this
way:
Context ctx = null;
Hashtable ht = new Hashtable();
Connection conn = null;
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFact
or
y");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
conn = ds.getConnection();
conn.setAutoCommit(true);
SvcEmpEstObt empEstObt = new SvcEmpEstObt();
empEstObt.setMaxRows(100);
empEstObt.setConnection(conn);
file://Get parameters from Http Get and set the JB
empEstObt.setEmpRut(request.getParameter("rut"));
empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
file://Execute Service
empEstObt.execute();
/* ********* the execute() method of the jb is listed here */
public int execute() throws ClassNotFoundException, SQLException{
intreturnedRows = 0;
try {if (connection == null){
try {Class.forName(driver);
} catch (ClassNotFoundException e) {
System.err.println("ClassNotFoundException: " + e);
throw e;
connection = DriverManager.getConnection(url, user, password);
row = -1;
srv_message = String.valueOf(maxRows);
String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?,?, ?,
oracle.jdbc.driver.OracleCallableStatement procout =(oracle.jdbc.driver.OracleCallableStatement)
connection.prepareCall(sp); // The exception is here
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
// execute the call
procout.execute();
sqlWarning = procout.getWarnings();
srv_message = procout.getString(1);
returnStatus = new Integer(srv_message.substring(0,1)).intValue();
dagMessage = new DagMessage();
dagMessage.oracleMessage(srv_message);
// access the value using JDBC default mapping
empEstTitulo = procout.getString(4);
empEstUniv = procout.getString(5);
empEstNivel = procout.getInt(6);
curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
curNombre = (String[]) procout.getPlsqlIndexTable(8);
curFecha = (String[]) procout.getPlsqlIndexTable(9);
curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
// close the statement
procout.close();
if (curCodigo == null) {
return 0;
} else {
return curCodigo.length;
} catch (SQLException e) {
SQLException ex = e;
System.err.println("\n--- SQLException caught ---\n");
while (ex != null) {
System.err.println("Message: " + ex.getMessage ());
System.err.println("SQLState: " + ex.getSQLState ());
System.err.println("ErrorCode: " + ex.getErrorCode ());
ex = ex.getNextException();
System.out.println("");
throw e;
Does Someone has an idea why it happens ? -
Need help using Windows Server 2000 JDBC Driver on Red Hat 9
I successfully have a .jsp app running on windows server 2000 using JDBC
driver for SQL Server 2000. Which I installed in order to the following
Red Hat:
http://msdn.microsoft.com/MSDN-FILES/027/001/779/install.htm
I moved the .jsp app over to the Red Hat 9 server running Tomcat, while
keeping the MS SQL 2000 on windows. The issue I have is setting up the
JDBC driver for SQL Server 2000 on the Red Hat server.
I created a folder called /usr/java/MSSQLdriver and unzipped the tar file with
the driver for SQL Server 2000. And ran the install.ksh script.
The /usr/java/MSSQLdriver/lib has the following files within it:
msbase.jar, msutil.jar, & mssqlserver.jar
I chmod 0777 each of the *.jar files.
I then went into /etc/profile.d/tomcat.sh and adding the following:
CLASSPATH=.;/opt/msSQLjdbc/lib/msbase.jar;/opt/msSQLjdbc/lib/msutil.jar;/opt/msSQLjdbc/lib/mssqlserver.jar
Each time I login and pull up the termial I get the following error:
bash: /opt/msSQLjdbc/lib/msbase.jar: cannot execute binary file
bash: /opt/msSQLjdbc/lib/msutil.jar: cannot execute binary file
bash: /opt/msSQLjdbc/lib/mssqlserver.jar: cannot execute binary file
And can't connnect to the database within the .jsp app.
Is there anyone out there using DBC driver for SQL Server 2000 on the Red Hat server?
MichaelSorry, I needed to correct some information of where the drivers were installed.
I created a folder called /usr/java/MSSQLdriver/new and untar the Microsoft file with the driver for SQL Server 2000. I ran the install.ksh script "sh install.ksh"
installed the driver into the default directory "/opt/msSQLjdbc".
The /opt/msSQLjdbc/lib has the following files within it:
msbase.jar, msutil.jar, & mssqlserver.jar
Michael -
Access denial on connecting SQL server 2000 with Microsoft JDBC driver
Hi guys,
I am developping a BMP invoking procedures stored in a SQL server 2000 instance on the Sun RI platform. I am using the Microsoft type 4 JDBC driver.
the connection pattern is something like
jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password;DataBase=Forethought;SelectMethod=cursor
An type-like "access denied" exception is raised when trying to get the connection from the DataSource object with some code similar to :
DataSource objDS = (DataSource)objCtx.lookup("jdbc/Forethought");
Connection objConn = ds.getConnection();
I have realised a CMP to access the database and everything works fine.
It seems that the SunRI tries to get the db connection with an "impersonated " user even if i have specified the user name and password in the connection string.
Does anyone have an idea how to force the connection with SQL Server user name and password ??I come accorss the same problem too,
my URL jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password=123;DatabaseName=pubs
and the password is right.I can establish connection to SQL server 2000 by JDBC Driver Manager,the code as follow:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=123");
Maybe you are looking for
-
Boa tarde, Estou em um projeto de implementação e com a seguinte dúvida: Requerimentos: Tenho que enviar o XML assim que a Invoice+NF é gerada (VF01/VF04, etc). Num segundo momento, após a aprovação do XML, eu poderei imprimir a DANFe. Envio XML: Sei
-
I am trying to create a GIF using CS3. I have read the discussions on Adobe but I get to a stage in the instructions and it is not working for me. I have 6 jpeg photos, and i bring them all into one. All photos are named different. After reading the
-
FIREFOX 3.6 WILL NOT STAY ON TOP PROBLEM BUT 3.5 WORKS FINE
WHEN I USE FIREFOX 3.6 OR ANY VERSION OF THE 3.6 AND I SELECT STAY ON TOP (I HAVE A THIRD PARTY PROGRAM THAT ALLOWS THIS) AFTER I MINIMIZE THE WINDOW THEN IT WILL LOOSE THE STAY ON TOP COMMAND. ALTHOUGH WITH FIREFOX 3.5 VERSIONS IT KEEPS IT'S STAY ON
-
Several best practice articles refer to using page aliases rather than page numbers for navigation. Obviously, using mnemonic names rather than arbitrary page numbers makes creating branches easier since the names are easier to remember. The articles
-
When I click on the song to play it, the name of the song doesn't appear. The time remaining doesn't appear either. All that appears is a black period in the middle of the screen...what is wrong??