1. possible to establish jdbc connection with file inside jar. forums.oracle.comIs it possible to establish a jdbc connection within the jar. The jar I will be using has the database file. For eg. The database used is sqlite. (uses file). The file is been archieved with the jar. How to initialize a jdbc connection with the db file in the jar. Thanks in advance. |
2. trouble with database connection forums.oracle.comi have installed mysql server 5.0 properly and can create and edit tables from the mysql command prompt, i ha ve also included the path to the jconnector (driver) in the windows path environment variable, but each time i try to conect from my program in i get a class not found exception. what could be the problem.the installed driver is ... |
3. jdbc fails connection forums.oracle.comjava.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement at com.acbt.ccstt.data.accessors.ConsignmentDAO.submitDeclaration(ConsignmentDAO.java:301) at com.acbt.ccstt.presentation.events.consignments.select.SubmitDeclaration.midAction(SubmitDeclaration.java:68) at com.acbt.ccstt.presentation.events.CCS21EventAction.execute(CCS21EventAction.java:36) at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) |
4. Check if JDBC connection is in use (Automatically) forums.oracle.comIf this is a web application, then why are you not using the ConnectionPool provided by the Web Container/Application Server. If you do that, all you need to do is retreive a connection when you need it (i.e. at each page hit) and close it as soon as it has done its work. The Pool will take care of everything else. ... |
5. Keep JDBC connection alive forums.oracle.comIn the future JDBC related questions should be posted into the JDBC forum. Taking the time to ensure your question is posted into the right forum increases your chances of getting better answers more quickly. My suggestion would be to use a Connection pool and let the connection pool handle the issue for you. Alternatively you will have to every so ... |
6. Junit connection to DB issue forums.oracle.com |
7. Connection to DB over Internet forums.oracle.comHey, I'm writing a program connects to a MySQL Database over the internet and uses the standard driver provided by MySQL. Now the questions I have is 1) Secure Is doing this secure? Like is the username and password that connects to the database visible and easily sniffed or is it encrypted? 2)Speed I'm using a gigaport switch but the connection ... |
8. Database Connection for PSQL 8.3 forums.oracle.com |
9. Java code for DB connection forums.oracle.comcon.close(); } catch (ClassNotFoundException e){ System.err.println("Could not load JDBC driver"); System.out.println("Exception: " + e); e.printStackTrace(); } catch(SQLException ex){ System.err.println("SQLException information"); while(ex!=null) { System.err.println ("Error msg: " + ex.getMessage()); System.err.println ("SQLSTATE: " + ex.getSQLState()); System.err.println ("Error code: " + ex.getErrorCode()); ex.printStackTrace(); ex = ex.getNextException(); // For drivers that support chained exceptions } } } } |
10. Database Connection design question forums.oracle.com@nclow - I will work on trying the Factory Pattern for this over the weekend and post when I finish to see what you think. @abillconsl - just to make sure I understand, you're saying that I just try to connect and it will cycle through the different database connection possibilities and connect when it finds the right one? If it ... |
11. Database connection in JavaScript forums.oracle.com |
12. Shall most non-transactional DAOs use the same Connection? forums.oracle.comHi Dears, In my application, most DAOs just do an executeQuery or executeUpdate. I think they actually can share the same connection or even the same statement! So in my application, I can simply use one connection for non-transactional DAO operations and only use other connections for transactional DAO operations. Do you think it's a good method? Thank you in advance. ... |
13. how to make a database connection in java forums.oracle.comI would like to add another connection provider for connecting to Visual Fox Pro .DBF files. It took me a little bit to figure out so thought I could save someone else the trouble so here it is: You need this driver installed on your PC if you do not have it already:. Microsoft OLE DB Provider for Visual FoxPro [VFP ... |
14. Database Connection forums.oracle.comHello to Everyone, I am getting this error for establishing a connection to the database: String url = "jdbc:oracle:thin:@c |
15. Database Connection on Application Startup? forums.oracle.comIm pretty new to java and want to setup an application wide variable. I know I can use application.setAttribute(x,x) I want one time when the application starts to setup a database connection pool, not each time someone starts the application. Then throughout my code whenever I need to I can just call the variable and pull a connection from the pool. ... |
16. DB Connection forums.oracle.comDear All, I am trying connect the database by using this code OracleDataSource ods = new OracleDataSource(); ods.setDriverType("thin"); ods.setServerName("jdbc:oracle:thin:@srv45"); ods.setDatabaseName("PT10GUTF8.AGI.COM"); ods.setPortNumber(1521); ods.setUser("saptesta2b8"); ods.setPassword("saptesta2b8"); con = ods.getConnection(); If i test this code i am getting this exception java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333) at oracle.jdbc.driver.OracleConnection. |
17. too many database connections open forums.oracle.comHi we are using struts, hibernate, and spring in a project. when a user starts testing, the application creates connections to the database but never closes them and the number of connections keep growing as the users continue hitting different pages. we have in OpenSessionInViewFilter singleSession=false we tried to use some connection pooling, but it doesn't seem to be working. can ... |
18. Java to a Database Connection forums.oracle.comI used your code and added a (ClassNotfoundException) "because it wouldn't let me compile without it. I also changed your line //pstmt = con.prepareStatement(sql); pstmt = conn.prepareStatement(sql); (because there was a slight typo) Then I go for a compile and run .. and I get the following ---------- Run Java ---------- GO Connection Successful Unable to connect SQL error: java.sql.SQLException: [Microsoft][ODBC ... |
19. database connections forums.oracle.comFirst rule, don't do it in JSP since they are supposed to be used in the presentation layer not in the bussiness layer. Hava a servlet do that at the very least. The best you could have, is a JNDI resource which would manage connection pooling to you for free. Best Regards, MeTitus |
20. How to improve jdbc 4 connection and Transact-SQL forums.oracle.com |
21. connection to database using OLE DB provider?? forums.oracle.com |
22. Which is efficient? (DB Connection and File Handling) forums.oracle.comHi, I need to download a file(CSV file of some 100-200 KB) on click of a button in JSP. The contents of the file is also displayed in the JSP (say page1.jsp)in formatted way so that user can print the details instead of download. 1st approach: before coming to page1, connect to DB(Oracle DB, using JDBC Connection pooling) and get all ... |
23. informix database connection forums.oracle.com |
24. how to fix jdbc connection when SQLstate 08S01 forums.oracle.comSQLException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection timed out: connect STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection timed out: conne ct at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja va:156) at com.mysql.jdbc.MysqlIO. |
25. database connection forums.oracle.comIm trying to a get a connection to my database on domain server one.com Code: { try{ Class.forName("com.mysql.jdbc.Driver"); //open driver connection System.out.println("Driver indlst"); Connection forb = DriverManager.getConnection ("jdbc:mysql://[mysql.blabla.com] ","username","password"); System.out.println("Forbindelse oprettet"); stmt = forb.createStatement(); }catch (Exception e) {System.out.println("no connection to your database");} } It doent seem to work do you have any ideas of what is wrong Info: MySQL: Host: localhost ... |
26. Design question for database connection in multithreaded socket-server forums.oracle.comDear community, I am programming a multithreaded socket server. The server creates a new thread for each connection. The threads and several objects witch are instanced by each thread have to access database-connectivity. Therefore I implemented factory class which administer database connection in a pool. At this point I have a design question. How should I access the connections from the ... |
27. connection tot database fails forums.oracle.com |
28. Help!! - if db connection is down & on again, the website doesn't work forums.oracle.comHi, Could someone please help me with this? I have a website application using Tomcat as server. The problem I have is every time database connection is off and on again (we are using IBconsole), we have to re-start Tomcat. Otherwise, the website doesn't connect to the database. Could someone please tell me how to make Tomcat recognize that db connection ... |
29. it might be a JDBC Connection problem, just guess. forums.oracle.comJust as a guess, does the name of your mysql Driver jarfile contain "-g". If so, you are using the debug version of the Driver, and that is what is causing your problem. Look through the zipfile you downloaded and find the Driver jarfile without the "-g", that is the production Driver and should solve your problem. |
30. JDBC connection issue's HELP! forums.oracle.com |
31. JDBC connection question forums.oracle.comInspite of setting the jar in my classpath why i am getting this error? In order to refer to a class in a different package, you need either to import the class or refer to it by a fully classified name (one that includes the package name in front of the class name). It seems you were getting that error because ... |
32. Database connection Problem ? forums.oracle.comHi, In my application I am calling the database connection to retrive and store the data from DB2. But sometimes randomly I am getting the exception like below. [IBM][JDBC Driver] CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000 My connection class is singleton. when ever I need the database connection I am calling the getConnection() from Singleton class. So can ... |
33. JDBC Connection forums.oracle.comNo, I didn't, but I didn't do so on the machine that works either. I have to admit, learning to code java almost entirely in eclipse, I have never had to directly work with a classpath, so if you can point me in the direction of where to learn how that would work in this case, that would be great. Also, ... |
34. establishing a connection with a database forums.oracle.comHi, can you tell me in which way I can establish a connection with a database? I'm working on NetBeans 5.5 and I put a database called "Object List" in its databases editor. I established a connection in that editor, but I don't manage to call that database from the source program and work with it. I'd need the statements and ... |
35. can i use single database connection in a hole java application? forums.oracle.comTheoretically you can. The first reply given here assumed that the answer to your question depends only on the design of your application. That is not true. It does also depend on the behaviour of the database in the background. Most databases have a time out for connections that are idle (some, like db2 on z/OS, even cancel connections, that are ... |
36. database connection forums.oracle.comHi All, I'm new to java and can anybody tell me how to do this ? I have two pages (page A and page B). In page page A, i have database connection( all typical JDBc driver, connect stmt etc). My problem is, when i navigate to page B, how can i use the page A database connection ? It would ... |
37. jdbc connection pb forums.oracle.comhello Im creating a programme that deal user's calendar I have function 1 : that will search the events of one day function 2 : that will call function 1 for 7 times function 3 :that is in another class ,I call function 3 in function 1 .function 3 return the object person with all info function 1,3 has instence of ... |
38. Database connections forums.oracle.comHi all I am working with a web application and I am getting the following error: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections I understand that that means that there is no connections available and that those that were available aren't being returned to the pool. Should the be anything other ... |
39. JDBC Connection Problem forums.oracle.comAm I the only one who didn't miss out on the irony of someone offering a Commercial JDBC driver for MS Access?? Eh? There are several (commercial drivers) in fact. Mostly they provide improvements over the bridge like - some at least are pure Java so you can use them independent of the OS - they offer more functionality and features. ... |
40. Best Database connection strategy. forums.oracle.comWhat my question boils down to is at what point should a connection be passes ? Should I be calling a get connection method that creates and passes a valid connection or should I be calling a get datasource method and create the connection locally ? (Bad examples but I hope they convey what I am asking) I am using connection ... |
41. JDBC connection establishing forums.oracle.comSorry for the above two posts when i am tried two connect with another database it is giving following error Inside get connection Metod java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323) at oracle.jdbc.driver.OracleConnection. |
42. JDBC Connection establishing forums.oracle.com} public Connection getConnection() { Connection connection=null; try { System.out.println("Inside get connection Metod"); try{ Class.forName ("oracle.jdbc.driver.OracleDriver"); } catch(Exception ex){ System.out.println("Cannot find database driver"+ex); } String strDatabaseURL ="jdbc:oracle:thin:@10.152.67.36:1521:******" ; String strUserName = "rmasupp1"; String strPassword = "Infosys"; connection =(Connection) DriverManager.getConnection(strDatabaseURL, strUserName, strPassword); System.out.println("after establishing connection"+connection); } catch(Exception E) { System.out.println("Exception Inside get Connection"+E); } return connection; } public long getRecordCount(Connection con) { ... |
43. Database Connection forums.oracle.com |
44. How to get total number of Database connections from Java code forums.oracle.com |
45. Problem with Login Control and Database Connection , please help forums.oracle.com//Connection conn = DriverManager.getConnection("jdbc:odbc:myOracle"); Connection conn = DriverManager.getConnection(cs,user,pass); Statement stmt = conn.createStatement(); String query = "SELECT * FROM members"; ResultSet rs = stmt.executeQuery(query); // ResultSet rs = stmt.executeQuery("SELECT * FROM members WHERE member_id = 'M0001'"); while(rs.next()) { String s = rs.getString("member_id"); System.out.println("\n Member ID. : " + s); } System.out.println("\nOracle at 255.255.255.255 is working!"); } catch(SQLException e) { System.out.println("\n\nException Occured " ... |
46. Db connection monitor forums.oracle.com |
47. JDBC with PostgreeSQL connection problem forums.oracle.comI have a very simple code just for testing a connection with JDBC using PostgreeSQL. I have a "postgresql-9.0-801.jdbc4.jar" as a library in my project. The problem is when I test the connection it came into an error like this: org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:150) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) at org.postgresql.jdbc2.AbstractJdbc2Connection. |
48. Application logs show 3 connections, yet JDBC logs show 5 connection forums.oracle.comHi, I am seeing a strange problem with our application code. We are investigating as to why connections are remaining open on our database from our application. Our JDBC driver is DB2, and we are using a DriverManagerDataSource to manage connections (I'm aware we should be using a connection pool, but that is a separate issue here). When I look at ... |