Can't use MySQL connectionpool?
I write two javabean in the package "lyo.bbs.xml...".I works well if I don't use MySQL ConnectionPool.But the jsp compiler report error if I use MySQL ConnectionPool in javabean.
One of my javabean is:"
ResultSet rs = null;
Statement stm = null;
Connection conn = null;
String sql = "select * from problem";
//String url = "jdbc:mysql://localhost:3306/test";
public ReadData(){
try{
Context ctx=new InitialContext(); <------If I use it jsp report error :(
DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
conn=ds.getConnection();
stm=conn.createStatement();
rs=stm.executeQuery(sql);
}catch(Exception e){
System.out.println(e.toString());
public List readD(){
List booklist=new ArrayList();
Readxml readbean=null;
try{
while(rs.next()){
readbean=new Readxml();
readbean.setId(rs.getInt("id"));
readbean.setName(rs.getString("name"));
readbean.setTitle(rs.getString("title"));
readbean.setContent(rs.getString("content"));
readbean.setTime(rs.getString("time"));
booklist.add(readbean);
////////////////////////////second javabean//////////////
public void setId(int id){
this.id=id;
public int getId(){
return this.id;
.............. .........getter and setter method............. ...........
public Element getXml(Document doc){
Element root=doc.createElement("guestbook");
NumberFormat idformat=NumberFormat.getCurrencyInstance(Locale.US);
Element temp=doc.createElement("id");
temp.appendChild(doc.createTextNode(idformat.format(this.getId())));
root.appendChild(temp);
temp=doc.createElement("name");
temp.appendChild(doc.createTextNode(this.getName()));
root.appendChild(temp);
temp=doc.createElement("Title");
temp.appendChild(doc.createTextNode(this.getTitle()));
root.appendChild(temp);
temp=doc.createElement("content");
temp.appendChild(doc.createTextNode(this.getContent()));
root.appendChild(temp);
temp=doc.createElement("time");
temp.appendChild(doc.createTextNode(this.getTime()));
root.appendChild(temp);
return root;
//////////////////////////////End code////////////////////
My jsp file is:
<%@page contentType="text/html;charset=gb2312" import="lyo.bbs.xml.*,java.util.*"%>
<html>
<body>
<%
Readxml readbean;
ReadData data=new ReadData();
List list=data.readD();
Iterator iter=list.iterator();
%>
<table border="1" bgcolor="#cceeee">
<tr>
<td>Topic</td><td>Name</td><td>Post time</td>
</tr>
<%
while(iter.hasNext()){
readbean=(Readxml)iter.next();
%>
<tr>
<td><a href="showtitle.jsp?id=<%=readbean.getId()%>"><%=readbean.getTitle()%></a></td>
<td><%=readbean.getName()%></td>
<td><%=readbean.getTime()%></td>
//////////////////error is://////////////////
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /showtopic.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\tomcat\work\Standalone\localhost\bbs\showtopic_jsp.java:7: package lyo.bbs.xml does not exist
import lyo.bbs.xml.*;
^
C:\tomcat\work\Standalone\localhost\bbs\showtopic_jsp.java:51: cannot resolve symbol
symbol : class Readxml
location: class org.apache.jsp.showtopic_jsp
Readxml readbean;
^
An error occurred at line: 6 in the jsp file: /showtopic.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\bbs\showtopic_jsp.java:52: cannot resolve symbol
symbol : class ReadData
location: class org.apache.jsp.showtopic_jsp
ReadData data=new ReadData();
^
An error occurred at line: 6 in the jsp file: /showtopic.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\bbs\showtopic_jsp.java:52: cannot resolve symbol
symbol : class ReadData
location: class org.apache.jsp.showtopic_jsp
ReadData data=new ReadData();
^
An error occurred at line: 16 in the jsp file: /showtopic.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\bbs\showtopic_jsp.java:68: cannot resolve symbol
symbol : class Readxml
location: class org.apache.jsp.showtopic_jsp
readbean=(Readxml)iter.next();
^
//////////////////////////////End error////////////////////////
But I have the package lyo.bbs.xml.. really.If I don't use MySQL Pool (java:comp/env/jdbc/mysql)it can work property.
I add the content in the server.xml and I registe in mysql console.
/////////////////////////////server.xml///////////////////////////////////
<Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="0" displayName="Welcome to Tomcat" docBase="C:\tomcat\webapps\ROOT\bbs" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/bbs" privileged="false" reloadable="false" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
<Resource auth="Container" description="mysql BBS XML Testing " name="jdbc/mysql" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/mysql">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/test</value>
</parameter>
<parameter>
<name>password</name>
<value>qijiashe</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>lyo</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
</ResourceParams>
<ResourceLink global="jdbc/mysql" name="jdbc/mysql" type="javax.sql.DataSource"/>
</Context>
Anyone can help me?
I use Weblogic6.1's ConnectionPool and it works well.It MySQL' problem?Why?
Similar Messages
-
Can we use MYSQL database with the UI5 application?
Hey,
I want to make an SAPUI5 application and there i have to use database to save the data.
Then, i will retrieve the data from there. Can we use MYSQL as a database to save the data.
If yes, then how we will retrieve the data from there?
Regards
VAIBHAV JAINHi Yury,
There's a lot of new technologies in order to acchieve that. You could create this app components:
1. Persistence layer. Hibernate/JPA connected to Relational ER Model in MySQL.
2. Service layer. Restful Services. With Spring (Getting Started &middot; Building a RESTful Web Service), Jersey (Jersey), etc.
3. View Layer. SAPUI5. Consume your services.
Hope this helps,
Kind regards! -
How Can I use Mysql's PROCEDURE by Java Can you give me sample???
�������^���������������H�iBEGIN�`END�u���b�N�j�@��TOP
ORACLE�@MSSQL�@SSA�@MySQL�@
���{�I���������������������������B
MySQL�������A ORACLE��MSSSQL��������������BEGIN�`END�u���b�N�����s�������������������������B
���������s�������������K���X�g�A�h�v���O�����������R���p�C�������K�v�����������B
�i�����F�������������������A���w�E�������������K�r�����������j
--drop PROCEDURE sp_hoge;
--�f���~�^�����X��������
delimiter //
CREATE PROCEDURE sp_hoge()
DETERMINISTIC
BEGIN
/* �������� */
DECLARE mystr VARCHAR(20);
DECLARE mycnt INTEGER(2);
/* �l������ */
SET mycnt = 0;
SET mystr = '����';
/* IF�� */
IF mycnt = 0 THEN
SET mystr = '�����Q';
select mystr;
ELSE
select '�����R';
END IF;
/* CASE�� */
CASE extract(month from now())
WHEN 1 THEN SET mystr = '1��';
WHEN 2 THEN SET mystr = '2��';
WHEN 3 THEN SET mystr = '3��';
WHEN 4 THEN SET mystr = '4��';
ELSE SET mystr = '1�`4�����O';
END CASE;
select mystr;
/* WHILE-LOOP */
WHILE mycnt <= 5 DO
SET mycnt = mycnt + 1;
select mycnt;
END WHILE;
/* BEGIN-END�u���b�N������SELECT�������s */
/* PROCEDURE�������\�iFUNCTION���������������j */
select * from help_topic;
END//
delimiter ;
--�X�g�A�h�v���V�[�W�����s
call sp_hoge();
�X�g�A�h�v���V�[�W�����T���v���i�J�[�\�����g�p������LOOP�����j�@��TOP
ORACLE�@MSSQL�@SSA�@MySQL�@
�J�[�\�����g�p����LOOP�������T���v�������B
�����p�����[�^���w�����������������Y�������������������A���E���w�X�^�b�t�x�������������A�����������w�c���X�^�b�t�F�x���\���������B
--drop PROCEDURE sp_hoge;
--�f���~�^�����X��������
delimiter //
CREATE PROCEDURE sp_hoge(inum INTEGER(3))
DETERMINISTIC
BEGIN
/* �������� */
/* �J�[�\���g�p�����f�[�^�L�����f���g�p */
DECLARE done INT DEFAULT 0;
/* �������O������ */
DECLARE v_mystr VARCHAR(20);
/* �J�[�\���g�p�� */
DECLARE v_empnm VARCHAR(40);
DECLARE v_job VARCHAR(20);
/* �J�[�\������ �� �����������������`���� */
DECLARE cur1 CURSOR FOR
select empnm,job from kemp where deptno = inum;
/* �f�[�^��������LOOP�E�o�p���������� */
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
/* �J�[�\���I�[�v�� */
OPEN cur1;
/* LOOP */
LOOPPROC:REPEAT
FETCH cur1 INTO v_empnm,v_job;
IF NOT done THEN
IF v_job = '�X�^�b�t' THEN
SET v_mystr = '�c���X�^�b�t�F';
ELSE
SET v_mystr = '';
END IF;
select CONCAT(v_mystr,v_empnm);
/* ������������LOOP���E�o����������LEAVE�� */
/* LEAVE LOOPPROC; */
END IF;
UNTIL done END REPEAT;
/* �J�[�\���N���[�Y */
CLOSE cur1;
END//
--�f���~�^���Z�~�R�����i�f�t�H���g�j������������
delimiter ;
--�X�g�A�h�v���V�[�W�����s
call sp_hoge(1);
12.2. Control Flow Functions
CASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN result ...] [ELSE result] END
CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END
The first version returns the result where value=compare_value. The second version returns the result for the first condition that is true. If there was no matching result value, the result after ELSE is returned, or NULL if there is no ELSE part.
mysql> SELECT CASE 1 WHEN 1 THEN 'one'
-> WHEN 2 THEN 'two' ELSE 'more' END;
-> 'one'
mysql> SELECT CASE WHEN 1>0 THEN 'true' ELSE 'false' END;
-> 'true'
mysql> SELECT CASE BINARY 'B'
-> WHEN 'a' THEN 1 WHEN 'b' THEN 2 END;
-> NULL
The default return type of a CASE expression is the compatible aggregated type of all return values, but also depends on the context in which it is used. If used in a string context, the result is returned as a string. If used in a numeric context, then the result is returned as a decimal, real, or integer value.
Note: The syntax of the CASE expression shown here differs slightly from that of the SQL CASE statement described in Section 17.2.10.2, �gCASE Statement�h, for use inside stored routines. The CASE statement cannot have an ELSE NULL clause, and it is terminated with END CASE instead of END.
IF(expr1,expr2,expr3)
If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2; otherwise it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used.
mysql> SELECT IF(1>2,2,3);
-> 3
mysql> SELECT IF(1<2,'yes','no');
-> 'yes'
mysql> SELECT IF(STRCMP('test','test1'),'no','yes');
-> 'no'
If only one of expr2 or expr3 is explicitly NULL, the result type of the IF() function is the type of the non-NULL expression.
expr1 is evaluated as an integer value, which means that if you are testing floating-point or string values, you should do so using a comparison operation.
mysql> SELECT IF(0.1,1,0);
-> 0
mysql> SELECT IF(0.1<>0,1,0);
-> 1
In the first case shown, IF(0.1) returns 0 because 0.1 is converted to an integer value, resulting in a test of IF(0). This may not be what you expect. In the second case, the comparison tests the original floating-point value to see whether it is non-zero. The result of the comparison is used as an integer.
The default return type of IF() (which may matter when it is stored into a temporary table) is calculated as follows:
Expression Return Value
expr2 or expr3 returns a string string
expr2 or expr3 returns a floating-point value floating-point
expr2 or expr3 returns an integer integer
If expr2 and expr3 are both strings, the result is case sensitive if either string is case sensitive.
Note: There is also an IF statement, which differs from the IF() function described here. See Section 17.2.10.1, �gIF Statement�h.
IFNULL(expr1,expr2)
If expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2. IFNULL() returns a numeric or string value, depending on the context in which it is used.
mysql> SELECT IFNULL(1,0);
-> 1
mysql> SELECT IFNULL(NULL,10);
-> 10
mysql> SELECT IFNULL(1/0,10);
-> 10
mysql> SELECT IFNULL(1/0,'yes');
-> 'yes'
The default result value of IFNULL(expr1,expr2) is the more �ggeneral�h of the two expressions, in the order STRING, REAL, or INTEGER. Consider the case of a table based on expressions or where MySQL must internally store a value returned by IFNULL() in a temporary table:
mysql> CREATE TABLE tmp SELECT IFNULL(1,'test') AS test;
mysql> DESCRIBE tmp;
-------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
-------------------------------------------+
| test | char(4) | | | | |
-------------------------------------------+
In this example, the type of the test column is CHAR(4).
NULLIF(expr1,expr2)
Returns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.
mysql> SELECT NULLIF(1,1);
-> NULL
mysql> SELECT NULLIF(1,2);
-> 1
Note that MySQL evaluates expr1 twice if the arguments are not equal.
Previous / Next / Up / Table of Contents
User Comments
Posted by I W on July 12 2005 5:52pm [Delete] [Edit]
Don't use IFNULL for comparisons (especially not for Joins)
(example:
select aa from a left join b ON IFNULL(a.col,1)=IFNULL(b.col,1)
It's terrible slow (ran for days on two tables with approx 250k rows).
Use <=> (NULL-safe comparison) instead. It did the same job in less than 15 minutes!!
Posted by [name withheld] on November 10 2005 12:12am [Delete] [Edit]
IFNULL is like oracle's NVL function (these should help people searching for NVL() ..)
Posted by Philip Mak on May 26 2006 7:14am [Delete] [Edit]
When using CASE, remember that NULL != NULL, so if you write "WHEN NULL", it will never match. (I guess you have to use IFNULL() instead...)
Posted by Marc Grue on June 24 2006 2:03pm [Delete] [Edit]
You can ORDER BY a dynamic column_name parameter using a CASE expression in the ORDER BY clause of the SELECT statement:
CREATE PROCEDURE `orderby`(IN _orderby VARCHAR(50))
BEGIN
SELECT id, first_name, last_name, birthday
FROM table
ORDER BY
-- numeric columns
CASE _orderby WHEN 'id' THEN id END ASC,
CASE orderby WHEN 'desc id' THEN id END DESC,
-- string columns
CASE orderby WHEN 'firstname' THEN first_name WHEN 'last_name' THEN last_name END ASC,
CASE orderby WHEN 'descfirst_name' THEN first_name WHEN 'desc_last_name' THEN last_name END DESC,
-- datetime columns
CASE _orderby WHEN 'birthday' THEN birthday END ASC,
CASE orderby WHEN 'desc birthday' THEN birthday END DESC;
END
Since the CASE expression returns the "compatible aggregated type of all return values", you need to isolate each column type in a separate CASE expression to get the desired result.
If you mixed the columns like
CASE _orderby
WHEN 'id' THEN id
WHEN 'first_name' THEN first_name
...etc...
END ASC
.. both the id and first_name would be returned as a string value, and ids would be sorted as a string to '1,12,2,24,5' and not as integers to '1,2,5,12,24'.
Note that you don't need a "ELSE null" in the CASE expressions, since the CASE expression automatically returns null if there's no match. In that case, you get a "null ASC" in your ORDER BY clause which doesn't affect the sort order. If for instance orderby is 'descfirst_name', the ORDER BY clause evaluates to:
ORDER BY null ASC, null DESC, null ASC, first_name DESC, null ASC, null DESC
Effectively the same as "ORDER BY first_name DESC". You could even add a new set of CASE expressions for a second order column (or more..) if you like.
Add your own comment.What is that post supposed to be?
-
Hello,
I have standalone OC4J and I want to use mySQL database (Oracle is no problem). My data-sources.xml for application (not global data-sources) is:
<data-sources>
<data-source class="com.evermind.sql.DriverManagerDataSource"
connection-driver="org.gjt.mm.mysql.Driver"
ejb-location="jdbc/MG_DBDS"
inactivity-timeout="30"
location="jdbc/MG_DBCoreDS"
name="MG_DBDS"
password=""
pooled-location="jdbc/MG_DBPooledDS"
url="jdbc:mysql://127.0.0.1:3306/test"
username="root"
xa-location="jdbc/xa/MG_DBXADS"/>
</data-sources>
Deploy return me:
Error initializing data-source 'jdbc/MG_DBCoreDS': DriverManagerDataSource driver 'org.gjt.mm.mysql.Driver' not found
Then I run this command:
java -jar %OC4J_HOME%\admin.jar ormi://192.168.1.14:23791/ admin heslo -application Register -updateDataSource -oldLocation jdbc/MG_DBCoreDS -jar mysql-2.0.11-bin.jar
this action is success and create in OC4J folder lib with jar file mysql-2.0.11-bin.
When I use this configuration in application, I get connection but creating Statement cause SQL Exception - No suitable driver.
When I try to restart OC4J, I get the same message as throught deploy - Error initializing data-source ...
What is go wrong???? Could me help anyone?
Thanks
Liborpooling solution:
1) put driver mysql.jar into any directory wich described in OC4J application.xml file like
" <library path="D:\j2ee\home\lib">jdev-generated</library>"
2) put a new datasource in data-sources.xml:
<data-sources>
<data-source name="MySqlDS"
location="jdbc/MySqlDS"
class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
max-connections="100"
min-connections="5"
inactivity-timeout="200"
wait-timeout="10"
username="scott"
password="tiger"
url="jdbc:mysql://localhost:3306/oln?useUnicode=true"/>
</data-sources>
OC4J needs a special pooling class in comparision with other containers. For example, JBoss has own implementation of pooling broker, so pooling is enabled by default. -
How to create ShoppingCart By Using mysql+Servlet+Html
Hi everyone:
I am working on a project using Jbuilder, which is a shopping site.
The functions are:
1, Access database and display all kinds of products in a table
2, Add the item you want into a Temporary Cart
3, Remove unwanted items from cart
4, Confirm the order
I can only use mysql + Servlet + Html.
I am at the step of display everything from the database, but i don't have any idea how to do the rest of the functions.
i have read lots of information, it seems that i need to use session tracking, and connection pool stuff.
Can any one give me some suggestions about how to design this project and how to implement it, and what kinds of thing i need to aware of.
cheers
LinHi,
i have idea about ur app in different env i.e. in different servers but i don't know how it will impl in jbuilder.i will send u link of whole shop app and also u can refer the wrox books and site. -
Can I use ODI for creating warehouse in MYSQL?
Hi,
I have Oracle 10g database. However, for the reporting and dashboarding purpose I want to create a warehouse.
Can I use ODI to pick data from this existing Oracle 10g database and create a warehouse using MYSQL?
Then I will use this MYSQL warehouse as source in OBIEE repository.
Kindly help.
Any documents/pointers would be really useful.
Regards,
PriyaHi,
I have Oracle 10g database. However, for the reporting and dashboarding purpose I want to create a warehouse.
Can I use ODI to pick data from this existing Oracle 10g database and create a warehouse using MYSQL?
Then I will use this MYSQL warehouse as source in OBIEE repository.
Kindly help.
Any documents/pointers would be really useful.
Regards,
Priya -
Can I use Oracle app server with mysql
Can I use Oracle app server with mysql. I seem to have the following error when trying to create a datastore. I have mysql.jar in my classpath. Can any one tell me what's wrong.
Error initializing data-source 'jdbc/topup': DriverManagerDataSource driver 'org.gjt.mm.mysql.Driver' not foundYes you can forward requests from your own apache to the iAS. This can be done using mod_proxy. Some hints about how to do this are availlable on this forum.
mod_oc4j is not a standard apache module, and therefore is not availlable when you download apache. There is no apparent reason to use mod_oc4j on a "regular" webserver (unless you want to build your own iAS). Also there might be some licenseing issues with using mod_oc4j module on a standard apache.
You can encrypt data that is passed from a random Apache to you iAS. -
Can I use Oracle APEX with MySQL Database
Hi All,
We are looking to create a performance dashboard using Oracle APEX for our client, but the application database is MySQL. Is it possible to create reports in APEX using data from MySQL database? If yes, are there any specific steps to be followed or any additional setups needed?
Any inputs would be really helpful.
Appreciate all the help
Thanks,
SameerHi Sameer,
it's not possible to use apex on mysql, as stated above me by several persons.
If you havent got any oracle database in your organization, apex would be an expensive choise unless you use the free Oracle XE (express edition), which has APEX embedded.
There are some limitations to XE but with a bit of smart thinking it wouldnt be much of a problem.
[check the XE information here|http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm#BABIECJA]
In short:
- XE will use 1 CPU even if you have two or more in your system
- There is a 4 GB data limit
- RAM memory usage is limited to 1 GB
- 1 installation per computer
You can use XE as a reporting database. This will relieve your mysql database from heavy reporting processes, too.
The XE can be used as a mini data warehouse. So you have to transfer and transform the relevant data from mysql to your XE instance.
After that you can start building report screens etc in the embedded Apex .
hope this helps you
Robin -
Hi. I´m trying use mySQL with SRTutorialADFBC tutorial. I can create connections. I can view my tables, etc. But when I try run the jsp page, I get a error 500:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:189)
at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:135)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:536)
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:326)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:87)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)
Can you help me?Thanks javaX. But the error continue... The message begin:
500 Internal Server Error
JBO-30003: The pool of applications (oracle.srtutorial.datamodel.AppModuleLocal) failed in the checkout module exception:
oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Erro ao abrir a conexão JDBC.
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)
Any new idea? -
Using MySQL DB on Weblogic 10.3.2 for JMS Store and etc.
Hi,
I am planning to use MySQL DB w Weblogic 10.3.2 server.
I am planning to use Persistent JMS Destinations and planning to use MySQL Datasource for JMS store.
Can anyone please help me understand any serious issues or considerations of this combination?
Thanks
SagarHi,
I am planning to use MySQL DB w Weblogic 10.3.2 server.
I am planning to use Persistent JMS Destinations and planning to use MySQL Datasource for JMS store.
Can anyone please help me understand any serious issues or considerations of this combination?
Thanks
Sagar -
when I type "rc.d start mysqld" it displays busy for a while, then fails. At this point it does not generate an error message. I have changed the permissions of /var/lib/mysql recursively to 777. I have also created the mysqld directory in /var/run and given it 777 permissions. I hope I have included all the relevant files.
I have read every suggestion on the internet and gotten nowhere. Please help a noobus out. Thanks in advance.
/var/lib/mysql/localhost.err
120115 01:11:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120115 1:11:48 [Warning] One can only use the --user switch if running as root
120115 1:11:48 InnoDB: The InnoDB memory heap is disabled
120115 1:11:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120115 1:11:48 InnoDB: Compressed tables use zlib 1.2.5
120115 1:11:48 InnoDB: Initializing buffer pool, size = 128.0M
120115 1:11:48 InnoDB: Completed initialization of buffer pool
120115 1:11:48 InnoDB: highest supported file format is Barracuda.
120115 1:11:50 InnoDB: Waiting for the background threads to start
120115 1:11:51 InnoDB: 1.1.8 started; log sequence number 1595675
120115 1:11:51 [ERROR] Can't start server : Bind on unix socket: Permission denied
120115 1:11:51 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
120115 1:11:51 [ERROR] Aborting
120115 1:11:51 InnoDB: Starting shutdown...
120115 1:11:51 InnoDB: Shutdown completed; log sequence number 1595675
120115 1:11:51 [Note] /usr/bin/mysqld: Shutdown complete
120115 01:11:51 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.pid ended
/etc/rc.conf
# /etc/rc.conf - Main Configuration for Arch Linux
# LOCALIZATION
# LOCALE: available languages can be listed with the 'locale -a' command
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
# startup and during the boot process. If set to 'no', the C locale is used.
# HARDWARECLOCK: set to "", "UTC" or "localtime", any other value will result
# in the hardware clock being left untouched (useful for virtualization)
# Note: Using "localtime" is discouraged, using "" makes hwclock fall back
# to the value in /var/lib/hwclock/adjfile
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# Note: if unset, the value in /etc/localtime is used unchanged
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="America/New_York"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
# HARDWARE
# MODULES: Modules to load at boot-up. Blacklisting is no longer supported.
# Replace every !module by an entry as on the following line in a file in
# /etc/modprobe.d:
# blacklist module
# See "man modprobe.conf" for details.
MODULES=()
# Udev settle timeout (default to 30)
UDEV_TIMEOUT=30
# Scan for FakeRAID (dmraid) Volumes at startup
USEDMRAID="no"
# Scan for BTRFS volumes at startup
USEBTRFS="no"
# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"
# NETWORKING
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
HOSTNAME="localhost"
# Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
# Wired network setup
# - interface: name of device (required)
# - address: IP address (leave blank for DHCP)
# - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
# - broadcast: broadcast address (ignored for DHCP) (optional)
# - gateway: default route (ignored for DHCP)
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
# DHCP example
# interface=eth0
# address=
# netmask=
# gateway=
interface=eth0
address=
netmask=
broadcast=
gateway=
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"
# Enable these netcfg profiles at boot-up. These are useful if you happen to
# need more advanced network features than the simple network service
# supports, such as multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
# Network profiles are found in /etc/network.d
# This requires the netcfg package
NETWORKS=(menu)
WIRELESS_INTERFACE="wlan0"
WIRED_INTERFACE="ethO"
# DAEMONS
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
# If something other takes care of your hardware clock (ntpd, dual-boot...)
# you should disable 'hwclock' here.
DAEMONS=(hwclock syslog-ng @network crond net-auto-wired dbus acpid)
/etc/hosts
# /etc/hosts: static lookup table for host names
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
#::1 localhost.localdomain localhost
# End of file
/etc/mysql/my.cnf
# MySQL config file for medium systems.
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Replication Slave (comment out master section to use this)
# To configure this host as a replication slave, you can choose between
# two methods :
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
# Example:
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
# OR
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
# The replication master for this slave - required
#master-host = <hostname>
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeoutHi,
I seem to have had an issue with mysql as well and it appears to be that I don't have a sock file as I have checked /var/run/mysqld for mysqld.sock and it does not exist so would that be what is stopping mysql server from starting and if so how do I create the sock file ??
Cheers
Quazza
Update - Actually I solved my problem to, it was to do with my log files filling up but that also led to the bigger problem of a failing HD oh what fun anyway got there before any major data loss.
Last edited by quazza (2012-01-20 08:09:26) -
How can I use multiple row insert or update into DB in JSP?
Hi all,
pls help for my question.
"How can I use multiple rows insert or update into DB in JSP?"
I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
With thanks,That isn't true. Different SQL databases have
different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
and there are also a lot of different ways of talking to
SQL databases that are possible in JSP, from using
plain old java.sql.* in scriptlets to using the
jstlsql taglib. I've done maintenance on both, and
they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
Well, sure. As long as you only want to update rows
with the same value in column 2. I had the impression
he wanted to update a whole table. If he only meant
update all rows with the same value in a given column
with the same value, that's trivial. All updates do
that. But as far as I know there's know way to update
more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
Unless you're using MySQL, for instance. I only have
experience with MySQL and M$ SQL Server, so I don't
know what PostgreSQL, Oracle, Sybase, DB2 and all the
rest are capable of, but I know for sure that MySQL
can insert multiple rows while SQL Server can't (or at
least I've never seen the syntax for doing it if it
does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
Don't assume that all SQL databases are the same.
They're not, and it can really screw you up badly if
you assume you can deploy a project you've developed
with one database in an environment where you have to
use a different one. Even different versions of the
same database can have huge differences. I recommend
you get a copy of the O'Reilly book, SQL in a
Nutshell. It covers the most common DBMSes and does a
good job of pointing out the differences.Yes, I understand that.
It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing. -
How can i use connection pool within the sqlj?
hello
i am a beginner to sqlj,i find all of the sample code from the oracle DON'T use connectionpool,they only write the database url to "connection.properties" file,but i think in the production environment we should use the connectionpool to optimise the querying,i usually use the weblogic connection pool.
how can i use the connection pool within the sqlj?
thank you very much!Im not sure if I understand. :)
English is not my best language...
Looking up the connection again? Do you mean I have to create new DataSource object and bind it again to ServletContext? -
[resolved] Can not install mysql
Oooops, I fixed it. Somehow /tmp had wrong permissions..
Hello,
after an upgrade my mysql dameon did not work anymore so I did what https://bbs.archlinux.org/viewtopic.php?pid=889846 says and removed all configs and removed it.
Now pacman -S mysql gives my this
# pacman -S mysql
resolving dependencies...
looking for inter-conflicts...
Targets (1): mysql-5.5.11-1
Total Download Size: 0.00 MB
Total Installed Size: 62.59 MB
Proceed with installation? [Y/n] y
(1/1) checking package integrity [################################################] 100%
(1/1) checking for file conflicts [################################################] 100%
(1/1) installing mysql [################################################] 100%
Installing MySQL system tables...
ERROR: 1 Can't create/write to file '/tmp/#sql_1d4d_0.MYI' (Errcode: 13)
110503 9:20:58 [ERROR] Aborting
110503 9:20:58 [Note] /usr/bin/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.
You can try to start the mysqld daemon with:
shell> /usr/bin/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/scripts/mysqlbug script!
Optional dependencies for mysql
perl-dbi
perl-dbd-mysql
The hostname.err contains
110503 09:29:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110503 9:29:53 InnoDB: The InnoDB memory heap is disabled
110503 9:29:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110503 9:29:53 InnoDB: Compressed tables use zlib 1.2.5
/usr/bin/mysqld: Can't create/write to file '/tmp/ibwoHE0m' (Errcode: 13)
110503 9:29:54 InnoDB: Error: unable to create temporary file; errno: 13
110503 9:29:54 [ERROR] Plugin 'InnoDB' init function returned error.
110503 9:29:54 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110503 9:29:54 [ERROR] Unknown/unsupported storage engine: InnoDB
110503 9:29:54 [ERROR] Aborting
110503 9:29:54 [Note] /usr/bin/mysqld: Shutdown complete
110503 09:29:54 mysqld_safe mysqld from pid file /var/lib/mysql/icarus.pid ended
And my my.cnl (I didnt touch it)
1 # MySQL config file for medium systems.
2 #
3 # This is for a system with little memory (32M - 64M) where MySQL plays
4 # an important part, or systems up to 128M where MySQL is used together with
5 # other programs (such as a web server)
6 #
7 # MySQL programs look for option files in a set of
8 # locations which depend on the deployment platform.
9 # You can copy this option file to one of those
10 # locations. For information about these locations, see:
11 # http://dev.mysql.com/doc/mysql/en/option-files.html
12 #
13 # In this file, you can use all long options that a program supports.
14 # If you want to know which options a program supports, run the program
15 # with the "--help" option.
16
17 # The following options will be passed to all MySQL clients
18 [client]
19 #password = your_password
20 port = 3306
21 socket = /var/run/mysqld/mysqld.sock
22
23 # Here follows entries for some specific programs
24
25 # The MySQL server
26 [mysqld]
27 port = 3306
28 socket = /var/run/mysqld/mysqld.sock
29 datadir = /var/lib/mysql
30 skip-external-locking
31 key_buffer_size = 16M
32 max_allowed_packet = 1M
33 table_open_cache = 64
34 sort_buffer_size = 512K
35 net_buffer_length = 8K
36 read_buffer_size = 256K
37 read_rnd_buffer_size = 512K
38 myisam_sort_buffer_size = 8M
39
40 # Don't listen on a TCP/IP port at all. This can be a security enhancement,
41 # if all processes that need to connect to mysqld run on the same host.
42 # All interaction with mysqld must be made via Unix sockets or named pipes.
43 # Note that using this option without enabling named pipes on Windows
44 # (via the "enable-named-pipe" option) will render mysqld useless!
45 #
46 skip-networking
47
48 # Replication Master Server (default)
49 # binary logging is required for replication
50 log-bin=mysql-bin
51
52 # binary logging format - mixed recommended
53 binlog_format=mixed
54
55 # required unique id between 1 and 2^32 - 1
56 # defaults to 1 if master-host is not set
57 # but will not function as a master if omitted
58 server-id = 1
59
60 # Replication Slave (comment out master section to use this)
61 #
62 # To configure this host as a replication slave, you can choose between
63 # two methods :
64 #
65 # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
66 # the syntax is:
67 #
68 # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
69 # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
70 #
71 # where you replace <host>, <user>, <password> by quoted strings and
72 # <port> by the master's port number (3306 by default).
73 #
74 # Example:
75 #
76 # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
77 # MASTER_USER='joe', MASTER_PASSWORD='secret';
78 #
79 # OR
80 #
81 # 2) Set the variables below. However, in case you choose this method, then
82 # start replication for the first time (even unsuccessfully, for example
83 # if you mistyped the password in master-password and the slave fails to
84 # connect), the slave will create a master.info file, and any later
85 # change in this file to the variables' values below will be ignored and
86 # overridden by the content of the master.info file, unless you shutdown
87 # the slave server, delete master.info and restart the slaver server.
88 # For that reason, you may want to leave the lines below untouched
89 # (commented) and instead use CHANGE MASTER TO (see above)
90 #
91 # required unique id between 2 and 2^32 - 1
92 # (and different from the master)
93 # defaults to 2 if master-host is set
94 # but will not function as a slave if omitted
95 #server-id = 2
96 #
97 # The replication master for this slave - required
98 #master-host = <hostname>
99 #
100 # The username the slave will use for authentication when connecting
101 # to the master - required
102 #master-user = <username>
103 #
104 # The password the slave will authenticate with when connecting to
105 # the master - required
106 #master-password = <password>
107 #
108 # The port the master is listening on.
109 # optional - defaults to 3306
110 #master-port = <port>
111 #
112 # binary logging - not required for slaves, but recommended
113 #log-bin=mysql-bin
114
115 # Uncomment the following if you are using InnoDB tables
116 #innodb_data_home_dir = /var/lib/mysql
117 #innodb_data_file_path = ibdata1:10M:autoextend
118 #innodb_log_group_home_dir = /var/lib/mysql
119 # You can set .._buffer_pool_size up to 50 - 80 %
120 # of RAM but beware of setting memory usage too high
121 #innodb_buffer_pool_size = 16M
122 #innodb_additional_mem_pool_size = 2M
123 # Set .._log_file_size to 25 % of buffer pool size
124 #innodb_log_file_size = 5M
125 #innodb_log_buffer_size = 8M
126 #innodb_flush_log_at_trx_commit = 1
127 #innodb_lock_wait_timeout = 50
128
129 [mysqldump]
130 quick
131 max_allowed_packet = 16M
132
133 [mysql]
134 no-auto-rehash
135 # Remove the next comment character if you are not familiar with SQL
136 #safe-updates
137
138 [myisamchk]
139 key_buffer_size = 20M
140 sort_buffer_size = 20M
141 read_buffer = 2M
142 write_buffer = 2M
143
144 [mysqlhotcopy]
145 interactive-timeout
I can't start mysql daemon, it says "FAIL"
Last edited by cyberius (2011-05-03 08:35:56)hi DILIPDKJ,
Just to verify, is this the PowerDVD software that you're trying to install?
PowerDVD 10 BD
v10.0.3029.52
IN12STW153WW5.exe
114 MB
Regards
Did someone help you today? Press the star on the left to thank them with a Kudo!
If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
Follow @LenovoForums on Twitter! -
Can i use single database connection in a hole java application?
can i use single database connection in a hole java application?.I have so many forms to use database connection.
Theoretically you can. Not only theoretically. I've seen lots of application which only uses one database connection (they were using, oracle or mysql)
The first reply given here assumed that the answer to
your question depends only on the design of your
application. That is not true.Yes it's true. Nothing in the original questions says that you aren't allowed to open or close the single connection that you have. It's looks more like the OP is interested in sharing a connection (i.e having a singleton or a connection pool with only one connection)
It does also depend on the behaviour of the database
in the background.
Most databases have a time out for connections that
are idle Not a problem. Most implementations of connection pools and applications which keeps a connection open have a timer which calls e.g. select * from dual (if you are using oracle) when the connection has been idle for X minutes.
(some, like db2 on z/OS, even cancel
connections, that are not idle, if they are open a
certain amount of time or have reached a given limit
of cpu seconds.)You would also have that problem if you had a connection pool with several connections.
In essence: If you have no control over the time
your application runs (and therefore your connection
is open) or over type or the configuration of the
database you are accessing, you can't do it.See above.
The closest thing to what you want would be using
PooledConnections, iif those are supported for the
database you want to access.Not true.
Kaj
Maybe you are looking for
-
1. how Do I solve this issue. 2. How do I ensure that i do not lose my playlists along with the songs. 3. What is the procedure needed to be followed.
-
How to publish iweb to ovh-hosting.fi?
I have tried to publish my homepage to that server ovh-hosting.fi with no luck. Is that a mission impossible? I wish somebody might help me
-
Unable to connect to a proxy server, unable to connect to a proxy server
i am unable to connect my iphone with my company's proxy server
-
is it possible to create a Linked List with a long as it's counter?
-
Is it possible to execute all the iterations of the inside for loop for each iteration of the outside for loop? I have attached a screenshot of my program if it helps. If it is possible could you tell me how to do it plz? Solved! Go to Solution. Atta