Connection 4 « Connection « Java Database Q&A





1. Sensing Stale connection    coderanch.com

In Webshpere App server, I noticed Oracle Datasource as a preTestSql parameter, which ensures that the connection obtained from pool is live one. But on the other database (DB2) I am not able to find such information. I thought isClosed() will throw an exception if its a stale connection. And yes you are right. I should really look into the Database ...

2. Validating user/password for database connection    coderanch.com

I am not familiar with JBoss, so I can't comment on what happens if you supply a username/password to the getConnection method. My suspicion is that you would still get a logical connection if the username/password combination matches. On physical connections ... I won't have thought that this is a good thing to do. In almost every case, it makes sense ...

4. database connections    coderanch.com

can anybody pls tell me one thing - which way is the right one to establish database conenction in web application? 1) establish db connection in init method and close it in destroy. In init method everytime before establishing check for existinng connection if not found then only call getConnect method 2) through out the application, whever reqd establish the connection ...

5. Database connection wont work 1st time but will work 2nd time? Help.    coderanch.com

Hello all. I'm new to the forum and excited to be here. I have a project written in struts with jsp pages and servlets. I access a mysql database that is on the same server as the code which is running on Tomcat 5.0. I am using a datasource for the mysql database in the code. I have this strange issue. ...

7. Synchronizing the connection object ?    coderanch.com

The only reason to sycnhronize a connection object would be if you were sharing it among multiple threads. Sharing a single connection among multiple threads is a very very very very bad idea. So no, don't allow more than one thread to use an open connection and then you don't have to synchronize. If you decide to ignore this advice and ...

8. Connection to PervasiveSQL fails    coderanch.com

Hello! I'm trying to connect to a PervasiveSQL Server but I fail. The driver that I use is pvjdbc2.jar (pvjdbc2x.jar might be needed). Here is my code Class.forName("com.pervasive.jdbc.v2.Driver"); String url = "jdbc ervasive://database_host_name:1583/source_name"; DriverManager.getConnection(url, username, password); But here is the stacktrace of the exception that it throws Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/pervasive/pscs/Manager at com.pervasive.jdbc.lna.LNAAbstractSession.handshake(LNAAbstractSession.java:111) at com.pervasive.jdbc.lna.LNASocketSession.handshake(LNASocketSession.java:74) at com.pervasive.jdbc.v2.Connection.(Connection.java:81) at com.pervasive.jdbc.v2.Driver.connect(Driver.java:57) ...

9. connection    coderanch.com

I am trying to retrieve data from a database but my code is giving problem in recognising the fields.I am encountering errors such as " variable title not found in class _Booking." It would solve my problem if i could find a code where the values in the field are being retrieved from a database.





10. securing a jdbc connection using ssl    coderanch.com

11. Establishing Connections with a database    coderanch.com

Hello, I have a general question about dealing with databases. I'm working on an IR system, and in the parsing phase we need to store words from one document into the database. Is it better to open a connection for storing each word, or maybe I should open a connection at the document level,taking into consideration the database security issue. Thank ...

12. How many connections    coderanch.com

HI TO ALL, here i want to execute 2 query's using same connection and same statement and resulset. is there anything wrong in this issue? should i need to do create seperate connections and stmt and result for both query's thanx in advace cinux [ April 01, 2006: Message edited by: Ernest Friedman-Hill ]

13. about jdbc connection    coderanch.com

there are alot of sample in the web . but as an example here : take a look at this code : package org.irsaa.kalali.jahan.jdbc; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class ResourceManager { private static String JDBC_DRIVER = "com.mysql.jdbc.Driver"; private static String JDBC_URL = "jdbc:mysql://localhost/myDb?useUnicode=true&characterEncoding=UTF8"; private static String JDBC_USER = "myuser"; private static String ...

14. static connection    coderanch.com

import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBLoader { private static final String driver "com.microsoft.jdbc.sqlserver.SQLServerDriver"; private static final String conn_URL = "jdbc:microsoft:sqlserver://xxxxxxxxx;databaseName=xxxxxx;selectMethod=cursor"; private static final String user = "xxxx"; private static final String password = "xxx"; private static Connection conn = null; /** Creates a new instance of DBLoader */ private DBLoader() { } private static DBLoader db = new ...

15. Regarding JDBC Connection (URGENT)    coderanch.com

Hi Friends, Myself Ankit. I am using java & oracle 10g. Rightnow I am creating connection. Use it to insert data into tables. But I want to make my program such that i can commit the insertion only at one time. Suppose I have three webforms in child pages i am inserting some data into tables, but i m not committing ...

16. Making Connection with database    coderanch.com





17. running out of connection    coderanch.com

i am working on the project where we have 25 no of connections and only 5 users are using the application ,still running out of coonection the code works fine on windows and apache ,but there is problem with websphere. where i get this error ...running out of connection connection pool is being implemented. so i think problem can be coonection ...

18. JDBC Connection    coderanch.com

19. refreshing a connection    coderanch.com

I am tring to refresh a Connection without closing it phsically from db. We are using a simple connection pool(hand-made ,and not mine ) How can i do that with out creating a new connection? I googled for it in the net and in this site ; http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm#1057365 They say ; "Closing a connection instance that was obtained from a pooled ...

20. no active Connection...jdbc newbie    coderanch.com

Hi fellow ranchers, this is a pretty lengthy question (sorry!) b/c I tried to put in as much detail about my problem as I can. I am totally new to JDBC and this server stuff, so please bear with me. I am getting this error: **************** at com.devx.tradingapp.model.Connect.getConnection(Connect.java:27) at com.devx.tradingapp.model.Connect.displayDbProperties(Connect.java:44) at com.devx.tradingapp.model.Connect.main(Connect.java:80) Error Trace in getConnection() : [Microsoft][SQLServer 2000 Driver for ...

21. define database connection    coderanch.com

22. Connection Statsus - Help Please    coderanch.com

Hi, I have one scenirao.In my application one my server will send messages and the applicaiton has to store them in the dataabse. I would like to know how to know the status of the connection. If the connection is not alive,I have to store the messages in a buffer and immdeaitly after the connection is live I want to store ...

24. How to access database without using the Connection object?    coderanch.com

There is no standard way, but I assume you could use JNI and some software client on the machine, or, if you are really versed in the DBs protocol, you could open a socket communicate with the database directly, but neither of these are truely feasable, but they are possible. What exactly is it that you need to do that you ...

25. Stale Database Connections    coderanch.com

26. DB Connection    coderanch.com

I can not paste all the object heres, but you can do it for yourself. Make a small program and create connection in it. Then debug the program. in your watch select the connection object and check all the values in the object. You are already familiar with most of the information stored in connection object.

27. Database Connection Hangs - getConnection()    coderanch.com

some suggestion : 1-make sure that your connection URL is correct in regard to service name and SID name , for example : If "ftdb" is your Oracle SID, connection would looks like : Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@85.20.15.120:1521:ftdb","USER_NAME","PASSWORD"); If "ftdb" is your Oracle service name, connection would looks like : Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@85.20.15.120:1521/ftdb","USER_NAME","PASSWORD"); if it is correct then ...

28. Static Connection object in BaseDAO class - Bad?    coderanch.com

Hi all, I'm not real well versed in data access logic and practices but I came across this and I'm wondering if this is real bad. This is the Base Data Access class for all our DAOs, it stores a static Connection object for all the DAOs to use and it only snags the connection on first use. Our web app ...

29. Problem retrieving connection when stress testing.    coderanch.com

Hello friends, I have this problem at getting connections when I stress test some of the Use Cases of my application. I used the OpenSTA testing tool for testing 100 users concurrently doing an application use case. Now, this is the problem that happens, when I do this test for 100 users, it really takes a very very long time for ...

30. Request critique and better way on my database connections    coderanch.com

I have a Servlet that calls another class file where I am choosing one of several different database actions. I am connecting to the database several times in the class file and I assume there is a better more efficient way of doing this? The below is only showing 2 out of 4 methods where I am showing dataHit and dataInsert ...

31. Connection to Progress Database    coderanch.com

Hi, I have found the drivers by installing the client components in the ProgressCD, these client components consists of the required jar files. I am able to load the driver but not able to make a connection with database. I am trying to connect to the remote Progress database9.1E on unix using JDBC from windows client. But the program would never ...

32. can we use an static method to return connections when we need them ?    coderanch.com

Hi thank you for reading my post I have an static method that i create some JDBC connection inside it. when ever i need a connection i call that method and the method will go tru connection creation scenario ( class.forname.....) I have doubt that it does not create new connections and always return the same connection because the connection returns ...

33. stale jdbc Connection    coderanch.com

After getConnection(), do I need to always test if the connection is stale? like do a dummy Select on a table and see if it does not throw an Exception? Before returning the connection object to the caller, do I need to do this? check if stale? If this is needed, is there a better way to check if stale? ..as ...

34. Objects used to create a connection    coderanch.com

Hi All, I am tryin to figure out some code that I have inherited, and am confused by this. It appears that the code makes a new poolableConnectionFactory object using a ConnectionFactory object which has url, username and password information. Where I get confused is that the poolableConnectionFactory object does not appear to be used. The PoolingDataSource object does not refer ...

35. ODBC-JDBC connection    coderanch.com

Hai, guys I was trying to connect a excel sheet data to mysql database. but some of my codes are not working properly try { Statement stmnt = connexl.createStatement(); String query = "SELECT * FROM [IJTS$]"; stmnt.execute(query); ResultSet rsxl = stmnt.getResultSet(); Statement dbsta = conndb.createStatement(); dbsta.execute("SELECT email_address, category FROM emailrec"); ResultSet rsdb = dbsta.getResultSet(); PreparedStatement p = conndb.prepareStatement("INSERT INTO emailrec(email_address,category) VALUES(?,?);"); ...

36. ODBC-JDBC connection and Looping    coderanch.com

Hai Guys, Thanks for your kind attntion about my software development project! I have a poroblem in ODBC _ JDBC connection infact the code is working properly, but there is bug in my loob condition and Resultset.next(); mehtod; I'll give more explanation adout the project; we need to update records from an excel sheet ( should not be use any convertable ...

37. connection problem    coderanch.com

need help in identifying what's wrong with my code.whenever i click create database button and query button nothing happens.i used system dsn and my dsn name is kingsley. my code is: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; public class ComputeSimpleInterest extends JFrame implements ActionListener{ private JTextField firstName,lastName,contactF,phoneF,prin,rateF,timeF; private PersonalInterest pp; private NameDemo name; private Address address; private Interest in; ...

38. Connection with database...    coderanch.com

Hi All, I want to retreive records from database but i have one problm in the below Code where should i pass my Server name and Database name..because my data is on server not on my local database..in below code "Data" is my database name and "Cust" is my tablename.. Pls help..... <%@ page import="java.sql.*" %> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %> ...

39. A question regarding Connection object    coderanch.com

In general, the Connection object would remain able to perform further operations. That certainly ought to be the case if the exception was due to bad SQL syntax, missing data etc. If, on the other hand, the exception was due to a lost physical link to the database, the Connection would be broken.

40. JDBC - Access Connection    coderanch.com

41. JDBC connection in different machine    coderanch.com

HI, I'm trying to connect with oracle installed in different machine. I've oracle client installed in my machine. So i'm writing like this: import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class NewConnection { static Connection con=null; public Connection getConnection(){ try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("Jdbc dbc:abcd","scott","tiger"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // ...

42. Single Connection Instance    coderanch.com

43. Help in tracking down open database connections    coderanch.com

I've inherited a large JBoss codebase that is, somewhere, not closing it's DB connections. I'm seeing errors like: org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] )) Exception caught while getting connection to java:/H2ST: No ManagedConnections available within configured blocking timeout ( 30000 ...

44. making the database connection in netbeanside5.5    coderanch.com

hi!!! this is gajera sanjay from surat.... i have worked on the netbeanside5.5 tool for my application i required the database connection for my application in this netbeans tool ... so please help me for that .. i do't know how to connect with the database in netbeans....please send me this solution as soon as possible....

45. jdbc connection    coderanch.com

46. JDBC Connection Issue    coderanch.com

I have a simple main method that runs to connect to a MYSQL database. The code compiles but it tells me that the database connection isn't established. public class Attune { public static void main(String [] args) { Connection conn = null; String userName = "root"; String password = ""; String url = "jdbc:mysql://localhost:3306/playlists"; try { Class.forName("com.mysql.jdbc.Driver").newInstance (); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/playlists", ...

47. Could not get a good connection to the database ?    coderanch.com

hi all, when I run *all* my test (~100) I receive the trace bellow. but when I run them one by one, they are all green. what does it mean: Could not get a good connection to the database, and how can I avoid it thank you com.ibatis.dao.client.DaoException: Failed to delete - id [criteria.abatorgenerated_deleteByPrimaryKey] - parameterObject [com.struts.domain.Criteria@7bd46a]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The ...

48. code for Database connection    coderanch.com

49. java applet-oracle database connection    coderanch.com

Welcome to JavaRanch. The code for connecting from an applet is the same as for an application. An important difference is that applets can only connect to the host where they were served from (i.e., the web server). If the DB is running on that machine, all works fine; if it isn't, no connection is possible. Which of these is the ...

50. detecting liveliness of connection    coderanch.com

How can I detect Liveliness of connection object? The situation is like this. I have a monitor application which needs to monitor the database and some applications which togeather with the database forms a complete system. As soon as the database goes down, monitor application sends signals to other application to shut them down. The problem is - how can I ...

51. Connection scope    coderanch.com

Hi! Would there be any difference if I put the Connection reference in the class scope but new connection is retrieved for every method versus having it inside the method scope? Assuming, we are using Connection Pooling? Thanks. 1) Connection in class scope public class MyDAO{ private Connection conn = null; public void openDAO() { if (this.conn == null) { this.conn ...

52. DB connection in webapplication.    coderanch.com

53. connection call    coderanch.com

54. jdbc connection in Idea    coderanch.com

55. Connection not available    coderanch.com

It is quite hard to say with the information you've provided.. Please post how you exactly tried to get the connection.. However if this error occured in a webapp.. It may be because the server is clustered.. That way only the instance that created the database can use it.. Requests sent through the other instance would not be processed.. Well i ...

56. Problem with the database connection    coderanch.com

Hi, I am trying to connect to the Oracle Database running on remote machine with WSAD. I am getting the following error message in the server startup. I am able to connect to the database running on the local machine. Can any one help regarding this. 8/7/07 11:03:46:062 IST] 4de2f2b6 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context ...

57. sharing connection object within methods    coderanch.com

Hi ALL, I need to know what is the best practice for connection object sharing. I have a method A that opens a connection object. queries the DB. There is another method call in the same method which needs a connection object. Is it a good practice to pass the same connection object from the calling method to the called method. ...

58. Connection con;    coderanch.com

59. connection object    coderanch.com

61. Single Database connection    coderanch.com

I would like to create a single Database connection point that I can use for 4 classes in my Java Web Application. Here is my ConnectionManager Class: public class ConnectionManager { private static Connection activeConnection = null; public static Connection getConnection() { if (activeConnection = null) { Class.forName("OracleThinInfoHere..."); activeConnection = DriverManager.getConnection("jdbc:oracle:thin:@myname:1234:orcl", "scott", "tiger"); } return activeConnection; } } Now how would ...

62. database connection    coderanch.com

63. Check JDBC connection leaks    coderanch.com

I made a little thing that never exposes connections. It has logic like: public void executeQuery( statement, handler ) { get connection execute statement call handler with resultset close resultset close connection } Those closes are in a finally block so it's impossible to forget to close things. It also eliminates a lot of duplicate setup and exception handling. There are ...

64. JDBC Connection Problem when I put my code in a package    coderanch.com

In advance I'd like to thank you for your comments and suggestions. First I will give a brief summary of my problem, a code snippet, and then add some specific environment settings etc. On an HP-UNIX machine with Oracle 10g I created a path setting to $ORACLE_HOME/jdbc/lib went to my playpen directory. I created a simple TestDB.java program for connecting to ...

65. DAO connection    coderanch.com

66. what is a connection?    coderanch.com

Recently one of our legacy applications was changed from a non-pooling data source to one that pools. Immediately connection leaks started. This made me realize that Java was garbage collecting the unclosed connections when the non-pooling data source was being used. With the pool calling close() on a connection was required to move it back to the pool. If close() was ...

67. Is this a connection problem???    coderanch.com

Hi Les Thanks for your message! But it seems that getActiveWorkflows() will not possible to throws any exception here if connection is OK. And from the work process, I never got exception from getActiveWorkflows(). Actually I got null for activeWorkflows below: public static void setVariable(WorkflowId workflowId, String name, Object value) throws XflowException { int wid = workflowId.getId(); Integer key = new ...

69. Connection attempt    coderanch.com

Is this a good way to insert and update into a database or is there anything I can improve? public class Sports { private Connection connection; public Sports() { connection = new DatabaseConnection().getConnection(); } public void Inserter(BeanMain objref) throws SQLException { if(connection != null) { PreparedStatement stat = connection.prepareStatement("Insert into FranchiseTable (team, manager) values (?,?)"); stat.setString(1, objref.getTeam()); stat.setString(2, objref.getManager()); stat.executeUpdate(); stat.close(); ...

70. Monitoring JDBC connection    coderanch.com

I haven't worked with TopLink but it seems to me that monitoring the DB connections won't help you find where the TopLink Session is not being properly closed which presumably is responsible for closeing the connection. This is a common problem not only with TopLink, but also with Hibernate, JPA, and straight JDBC. One thing you can use to help avoid ...

71. database connection    coderanch.com

72. SQLServerException: TCP/IP connection to the host has failed.    coderanch.com

Hi, I just migrated my java web application to a new laptop that has Window Vista on it. However, when I try to start up the Tomcat Server, I'm getting the following error: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) On application ...

73. XA Connection    coderanch.com

74. jdbc connection    coderanch.com

import java.sql.*; import java.io.*; import java.util.*; import java.awt.event.*; import java.sql.ResultSet; public class Connect1 { public static void main (String[] args) { String createString; createString = "create table Credit cards " + "(cardid int not null PRIMARY Key, " + "name varchar(50), " + "type varchar(20))"; Statement st; Connection conn = null; try { String userName = "dialer"; String password = "1234"; ...

75. Using single connection cause memory problems?    coderanch.com

Hi all, In our project, they have used singleton pattern for connection handling part such that not more than one connection is open to the database. So, the same connection will be used again and again. will this actually affect memory usage in any way? Because recently we had some issues and had to monitor the memory usage and it seemed ...

76. Problem using JDBC connection in NetBeans IDE    coderanch.com

Hi all.. I have gone through FAQ's section. But I have not found any answer for my problem, so I am posting it here. I am able to connect to the Oracle database using a "hello world" kind of program(like able to retrieve the data from a table in the database). But the problem is when I am trying to develop ...

79. jdbc connection !!    coderanch.com

80. database connection for n java files    coderanch.com

81. Connection poll    coderanch.com

82. Too many connections    coderanch.com

Anyone please tell me the possible problem in getting the below mentioned error Environment: Tomcat5.5 Mysql 5.0 Ibatis com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Too many connections at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2644) at com.mysql.jdbc.Connection.(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:580) at com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:565) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:540) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:84 [ ...

83. Cursor is incrementing for a connection    coderanch.com

Hi, Java method is invoking a Stored Procedure. in the finally block, the corresponding Resultset and Statement is closed. Connection is not closed, as it is reused. The method has been checked for the same many times, however from Database side query, it is evident that the cursor number is increasing for the connection. What is the reason of increasing the ...

84. connection to db    coderanch.com

85. Kill Sleeping Connections?    coderanch.com

Hello, I have a question concerning connection pooling in Tomcat 6. When you close a connection and it is returned to the pool, is it supposed to stay there indefinitely? Is there a timeout that will kill the connection if it is not reused after a few hours? After running a query, I make sure to close the statement, result set, ...

86. Connection Method    coderanch.com

Hi everyone, I need some suggestions from you experienced programmers. I want to know if it's ok to make a static get_Connection() method where I put all the access code to open a connection and have another separate static method where I can close the same connection, statements or resultset. Is this doable? or do I have to do all of ...

87. 2 files in same connection    coderanch.com

Hi everyone, i need to create a new table(newtable), in a new database file (newdb.mdb)from an existing file (old.mdb), (oldtable). Can i do it in a single connection as below? The code below copies the table to the exixsting database file. try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("Starting DB"); String filename = "d:/java/db4.mdb"; String database = "jdbc :o dbc :D river={Microsoft Access Driver (*.mdb)};DBQ="; ...

88. Finding the number of active database connections    coderanch.com

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ...

89. Connection Object as Static in a J2EE Application    coderanch.com

Hi Neha, if you run a real Java enterprise application you will usually use an application server, too. Right? It's one of the features of an application server to manage database connections. And in my opinion it will do this job better because you have tested and stable connection pool management and so on already built-in. I'd recommend to use this! ...

90. Open Connection Objects    coderanch.com

91. connection with mysq database    coderanch.com

92. database connection    coderanch.com

93. Unable to get a Connection Object    coderanch.com

I have a particular scenario where i have five methods in a class. All of the methods require to connect to database to perform some operation So what i ideally want to do is have five operation specific methods and one DBMethod where i establish the connection and return back the connection object . i.e the signature would be like public ...

94. Need Suggestion ? JDBC Connection    coderanch.com

I have two classes, #1 . One for logging #2 . One for reading configuration Logging and the reading configuration are all done at the oracle. To perform these operation at oracle, both classes need to get a connection to oracle. Right ? Shall i create a single connection object to do this ? 'means' can Connection con = one connection ...

95. Optimizing Database Connection ?    coderanch.com

Jeanne. My SQLManager contains all the database access rather than doing each access in the servlets itself. So effectively, servlets just call a SQLManager and they have all the possible methods available so that I don't need to re-code the database access within each servlet itself. I was wondering if each servlet calls a new SQLManager , I was afraid it ...

96. Database connection    coderanch.com

97. Choosing the right connection pooler    coderanch.com

Hi.. I am writing a standalone batch application ... It is multithreaded and the expected DB transactions per second is around 2000.. It primarily is written with Oracle 10g .... but ideally should be database independent... Since I have no server runtime ... I can't use container managed connection pools.... The open source option which I saw is apache commons DBCP... ...

98. Returning DB connection    coderanch.com

It actually depends on how you intend to use the connection. As a simple scenario, let us say you execute some queries (select/update) but only one at a time. Creating connection each time is not the right way and you can use the same connection. You want to execute many queries simultaneously, then you can still reuse the connection provided you ...

99. Problem in creating a database connection    coderanch.com

Hi, am trying to create one database Connection in Oracle SQL developer and when I try the connection for "Test" it is showing the status as -->> Status: failure-listener refused the connection with the following error:ORA-12505, TNS:Listener does not currently know of SID given in connect descriptor, used by the client.. am using "Basic" as connection type and "default" as Role. ...

100. establishing database connection    coderanch.com

well, it loads the Driver :-) ok, here is my shot at it: if you run this code: public class ClassForNameTest { public static void main(String[] args) { System.out.println("Now Executing main()"); try { Class.forName("FakeJDBCDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } public class FakeJDBCDriver { static { System.out.println("Now intializing Driver properties"); } } then you will see following output: ...