connect 1 « Connection « Java Database Q&A





1. Pattern for connecting to different databases using JDBC    stackoverflow.com

I'm writing an application which has to be configurable to connect to Oracle, SQL Server and MySQL depending on client whim. Up till now I'd been planning on using the JDBC-ODBC bridge ...

2. How to connect to database from Jython    stackoverflow.com

I cannot connect to database from my Jython program. Pure Java programs can connect, and I can connect to db from Jython but only using JDBC-ODBC bridge: "sun.jdbc.odbc.JdbcOdbcDriver". If I use ...

3. What's the right way in Java to connect to a Microsoft Access 2007 database?    stackoverflow.com

I'm trying to create a simple connection using the jdbc-odbc bridge:

public static Connection  getConnection() {
    Connection con =null;
    try {
     ...

4. How do I connect to an Access database over a LAN using Java?    stackoverflow.com

Do you know of any good guides on how to access an Access database using Java? I know the basics and basic SQL, but I'm thinking more about access control. ...

5. Connecting to Progress database from Mac OSX    stackoverflow.com

Does anyone know how to connect to a Progress 9.1E database from a Mac (or even from Linux)? I can connect successfully from Windows but the JDBC driver requires that the Progress ...

6. How to connect OpenBase DB using HSQL in JAVA    stackoverflow.com

can any one show code/tutorial? i googled the most.

7. JDBC - Connect Multiple Databases    stackoverflow.com

I am working on an application where I need to connect N number of database systems [N ranges any where between 1 to 350]. The idea is - the user will be ...

8. connecting database in regular interval    stackoverflow.com

I have a situation where I have to check for a value in a database say aValue. If aValue is availabe then do process aValueProcess(). If the value is not available, I only ...

9. Connecting Java to a Database?    stackoverflow.com

I have connected Java to MySQL DB with the following code and it is working, Can anyone explain me what each line does?

Class.forName("com.mysql.jdbc.Driver").newInstance();
        con ...





10. Connecting to a Database with Java    stackoverflow.com

I'm very confused about how to connect my Java application to a database, any database. I'm not sure where to start. Could anybody provide for me a simple example that might ...

11. java connecting to MicrosoftSQLServer 2005    stackoverflow.com

Java Connecting with MicrosoftSqlServer 2005.

  • IDE Used: Eclipse helios
  • Driver used: sqljdbc.jar
  • .dll used: sqljdbc_auth.dll from x86 folder.
  • .dll is added to system32 folder rebooted system.
  • Ping succeeded connecting eclipse with SQL server 2005 using sqljdbc.jar
Error ...

12. connect to multiple databases at the same time in openBravo?    stackoverflow.com

I want to connect to multiple databases at the same time in openbravo so I would be able to store data in two different databases(for example: mysql and postgresql) for any ...

13. How to connect a database with a mobile application?    stackoverflow.com

I want to make an application in j2me so that it interacts with database and keeps updating it. How can i connect my mobile application to the pc which has the ...

14. Java: connecting to db to fetch data    stackoverflow.com

I have a question regarding Java when fetching data from, lets say MySQL database. As of now I need to write quite a lot of redundant code when fetching data. And ...

15. UnknownHostException trying to connect to Cloudant DB via Ektorp    stackoverflow.com

It's not clicking how one is supposed to connect to a hosted Cloudant database using Ektorp. I'm using Ektorp 1.1 in Eclipse via the new m2eclipse ...

16. How to structure code when connecting to databases    stackoverflow.com

I am developing a program in Java that I will use for registering data. I store the data in a MySQL database. We have not been making "big" programs in my ...





17. Connecting Berkely DB in java through sqlitejdbc-v056.jar    stackoverflow.com

i am connecting berkely database through sqlitejdbc-v056.jar & i got the following error and not performing insert ,update ,delete opration

java.sql.SQLException: database is locked
        at ...

18. Problem in connecting to Berkely DB from java    stackoverflow.com

i have download & install Berkeley DB 5.1.25.msi Windows installer from oracle.com then after i have created table in berkeley DB using following code

c:\Program>"C:\Program Files\Oracle\Berkeley DB 11gR2 5.1.25\bin\dbsql" Emp.db
Berkeley DB 11g ...

19. How to connect JAVA MIDLET to ORACLE/MySQL database Using Netbeans?    stackoverflow.com

I got the code for connecting java midlet to mysql in three parts[midlet,servlet and standard java]. but netbeans doesn't allow except midlet in Mobile Project which i created from_____________________ ...

20. Want to connect berkeley db with java using db and jdbc jar    stackoverflow.com

I have installed Berkeley DB 5.1.25.msi Windows installer, I got db and jdbc jar in C:\Program Files\Oracle\Berkeley DB 11gR2 5.1.25\jar folder So how to use this two jar to connect with java ...

21. Why can't I access a remote database trough Java?    stackoverflow.com

I am trying to make an Java application, which needs a connection with a MySQL database to read data. I've read several tutorials and examples, tried almost everything but I just can't ...

22. How to get MS-Access Database online and connect to it using Java?    stackoverflow.com

I am writing a game in Java, it is an applet. I want the user to create an account, and have it registered into a database. I know how to create ...

24. Connecting to a database dynamically    forum.springsource.org

Connecting to a database dynamically Hi I have a use case where the user will select a region, and based on the selected region, I need to connect to that database ...

25. Problem with connecting to the database :(    forums.netbeans.org

U haven't included the drivers jar file in your applications classpath. -- View this message in context: http://www.nabble.com/Problem-with-connecting-to-the-database-%3A%28-tp24967767p24985635.html Sent from the Netbeans IDE Users mailing list archive at Nabble.com.

26. Problem Connecting Database Application (Desktop)    forums.netbeans.org

Hi, i have a problem connecting my created database application (following the create custom database application tutorial in NetBeans) Using PostgreSQL. I can connect i'm my own computer but when i'm ...

27. Hi Not able to connect with the database    forums.netbeans.org

Hi guys I had created an application long days back using netbean. Now i have installed netbean 6.0.1 in my machine . Whenever i try to create a derby database connection ...

28. Crystal Reports (XI)can't Connect/ Log On to NetBeans (6.7.1) DataBase    forums.netbeans.org

I am on a PC with Windows XP. In the Crystal Reports inside the 'File Logon Dialogue Box' I go: Create New Connection -- JDBC -- Connection URL = jdbc:derby://localhost1527/Time Table ...

29. Connecting to database from my form    forums.netbeans.org

I have a button on my form. I want the button to connect to the database whenever the button is clicked. I am using the MySQL database embedded inside of NetBeans ...

30. Access database connect trouble    forums.netbeans.org

Connecting to a .mdb database which has been placed inside the project folder. The project runs fine on the school computers (Netbeans 6.5 - WinXP (x86)) As soon as I bring ...

31. Help with connecting to a database    forums.netbeans.org

Hi Everyone I'm trying to set up a database and connect to it, this is the first time I've tried it and it's not going well. I followed several tutorials but ...

32. Can't connect to database from application    forums.netbeans.org

Posted: Tue Jul 13, 2010 6:05 pm Post subject: Can't connect to database from application I am working on a netbeans 6.9 JavaFX project I am trying to ...

33. Connecting to LOCAL MDB database through the app creation forms...    forums.netbeans.org

Hey, I am trying to create a database driven application with a list view and details view. I have one window which is titled "New Desktop Application" and another one on top of that called "New Database Connection". I have a .mdb database already created and designed in the "Data" directory of the application. I would like to connect the application ...

34. Code to connect to database not working    forums.netbeans.org

public static void connectToDatabase() { String host = "jdbc:derby://localhost:1527/Test1"; String uName = "APP"; String uPass = "APP"; try { ...

36. Connecting to database by using JDBC request    jmeter.512774.n5.nabble.com

Hi i have a doubt regarding how to connect to database by using jmeter... i have prepared the test plan as specified in the usermanual...i dounloaded the "mysql-connector-java-bin.jar " file and copied that jar file to lib directory hear am listing the details which i had given in Database Connection Configuration Database URL: jdbc:mysql://192.168.1.101:3306/ams_newaug9 JDBC Driver Class:com.mysql.jdbc.Driver Username: xxxx Password:xxxx ...

37. Connecting to Access DB on website    coderanch.com

Hi all, I have created a website that contains an MS Access DB. I have also created a Java application that offers the ability to make changes to the DB. There is no problem when the DB is on my system but I cannot figure out how to connect to the DB on the website. This code works fine on my ...

38. jdbc connect Access    coderanch.com

39. JDBC can i connect    coderanch.com

simple to do list: 1. politytool 2. create an odbc dsn entry to us a text file database 3. use jdbc 1.0 open the driver and insert rows... hope this helps! import java.sql.*; //import all the JDBC classes public class CreateJoltData { static String[] SQL = { "create table JoltData ("+ "programmer varchar (32),"+ "day varchar (3),"+ "cups integer);", "insert ...

40. Connect String    coderanch.com

41. Connecting 4 Databases together    coderanch.com

43. Connecting to a remote host    coderanch.com

I am working with a project that is able to transfer databases to various work stations. Right now, I can connect easily to a database that is on the same workstation. Now I would like to connect to a host that is not on the network. I have researched the documentation on the formation of the url..and here is what I ...

46. Can't connect to Access database using Cloudscape    coderanch.com

Hi I have the following code: import java.sql.*; public class Exercise2_1 { static String driver = "COM.cloudscape.core.JDBCDriver"; static String url = "jdbc:cloudscape:c:/j2sdkee1.3/cloudscape/test2"; public static void main(String[] args) { try{ Class.forName(driver).newInstance(); System.out.println("Loaded driver"); Connection conn = DriverManager.getConnection(url); System.out.println("Connected to database"); conn.close(); System.out.println("Closed connection"); } catch(Throwable e) {System.err.println(e.getMessage());} } } The driver loads fine. However, I get an error message saying "Can't find ...

47. Connecting to an existing db    coderanch.com

I've created a MySQL database on my local workstation. Made a table and added some info and so forth. Now my question is how can I connect to that database with a JDBC connection? I'm having issues with the whole "JDBC driver" deal really. Do I need a specific one or something? At first, I used one found by going to ...

49. JDBC Connect problem    coderanch.com

I have a connection problem with Oracle on Windows98.Iam using the JDBC url and the Oracle driver to connect to the database. Iam getting a network connection failed error.Does anybody know why this is happening? Iam using Oracle8i personal edition on Windows98.I dont have any listeners configured.Do I need to do this?I figured that I need not do this , since ...

50. Connecting to FoxPro database    coderanch.com

51. How to connect to remote Database Using IPAddress    coderanch.com

There may be another way to solve your problem. If you are using a UDB version of DB2. You can use Client Confifurations Assitant (cca) to help you. I can help ... if you are using a UDB version of DB2. I need to know few things first: 1. OS of client 2. OS of database server 3. version of java ...

52. need help connecting to Access DB    coderanch.com

Josh, I gave you the code in the other thread it is as follows: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc :-o dbc:Josh"; Connection con = DriverManager.getConnection(url); It is important that the DSN entry must have the same case as the url assignment. So, here it would be Josh. My suggestion would be to use all upper or all lower case. The DSN ...

53. Connect to database on client?    coderanch.com

55. connect JDBC with MS Sql2k,but failed    coderanch.com

import java.sql.*; import javax.sql.*; public class TestDbConnection{ public static void main(String args[]){ // int result = 0; // Connection cnn = null; Statement smt = null; ResultSet rst = null; String requestString = null; try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); // String url= "jdbc:microsoft:sqlserver://localhost:1433"; Connection conn = DriverManager.getConnection ("jdbc:microsoft:sqlserver://localhost:1433","sa",""); System.out.println("u r greatsuccessfully"); } catch(Exception e) { e.printStackTrace(); System.out.println("u r failed"); } } } what`s ...

56. how to connect Access using jdbc?    coderanch.com

57. Java program on Solaris runs slow when connecting to database on same system    coderanch.com

Hi all, I'm developing a Java program to read a large no. of records (arnd 40,000) from a file and populate into an Oracle database on a Solaris system. I'm using a thin JDBC driver. The problem is that the program runs very slow on Solaris. When I run the Java program on a Windows machine (and connect to the Solaris ...

58. How to connect to a DB thru a firewall? JMS?    coderanch.com

OK, this is a somewhat complicated situation. We are implementing a package customer care solution where we can only change the JDBC driver without rewriting significant amounts of the product's code. The problem is that for security reasons, sensitive data must be stored in the secure zone. This packaged application is in an unsecure zone. The package implementation needs access to ...

59. Controls to connect database    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. - ...

60. Problem connecting to Access database. Help needed..    coderanch.com

Greetings, I have this little problem connecting the Java application I'm currently developing to a database on my PC. My PC's operation system is Windows 2000. And I have J2sdk1.4.0 installed. I'm trying to create what looks like a database which a bank would have. I created the database using Microsoft Access,it only contains a only one row presently..... The program ...

61. connecting to database    coderanch.com

Hi i'm sort of new to jdbc programming.. i was just trying to test how to connect to a db. I have created a db in access. The url i specify is jdbc dbc:MyDatabasename and i'm using the sun.jdbc.odbc.JdbcOdbcBridge driver. When i run the program it says that failed to load the driver and could not find the database source.. now ...

62. Connecting to Access    coderanch.com

63. how to connect to a remote database    coderanch.com

Guys... anybody can help me on this... I need to write a class which can connect to an (oracle) database (remote / local). For the local database, i dont have a problem. But how do i connect to oracle db residing on a remote server. Any help will be appertiated. [ February 20, 2004: Message edited by: Dharmesh Gangani ]

64. connect to PointBase using JDBC    coderanch.com

65. connect to maxdb database from wsad    coderanch.com

66. database not connecting to application    coderanch.com

Hi, I want to run my applcation on net. hosting server is linux OS. all port and userid and password r correct. I downloaded the unix .tar file for SQL Server jdbc driver from microsft download site to my windows desktop. I then extracted the 3 mssql*.jar files and uploaded them to the linux in web-inf\lib as well as web-inf\classes. When ...

67. connecting database with javacompiler    coderanch.com

68. Not able to connect to a database    coderanch.com

You have shown us all of the pieces except for one: where the "jdbc/BooksDB" resource is defined. With TOMCAT you need to have a " ... " tag for your web application. Within that tag you must define the "" and "" tags for the datasource. [Alternately they could be in the "" tag, but that's usually a bad ...

69. Problem with Connecting    coderanch.com

Hi, I have PointBase database running and I started PointBase Admin Console just to check few things. At the sametime, when I ran my Java program that accesses PointBase, it gave me error that some other application is already using it. Is locking so dumb that it can't allow more than one access? Or Am I missing something? Thanks , Rajeev. ...

70. connecting to Remote Database    coderanch.com

Hi, I want my swing application connect to a remote database(MySQL) and return resultsets. Now I am getting data directly from remote DB using remote DbURL =jdbc:mysql://remote IP address:3306/dbname DriverManager.getConnection(remotedbURL, remoteuserName, remotepassWord); Is there any problem getting records like this? What is the best way of doing this? Is this through RMI?(any reference sites for Tomcat RMI)or any other way? Thanks ...

71. connect to mdb file and get the data using jdbc on AIX(RS/6000) machine    coderanch.com

Hello, I am having one mdb(MS Access) file present on AIX machine and my application is also going to execute on AIX machine. I want to connect the mdb file and get the data from that file. can u tell me is there any driver present which will help me in that Thare are some driver (type 3) like aveConnect etc, ...

72. connect to dbf file(fox-pro) database    coderanch.com

73. How to connect a J2EE program to an Access Database    coderanch.com

Not sure if you are asking for the connection strings or the form for JDBC, so I'll give you both in this little snippet. You need to first create an ODBC driver using MS' ODBC manager. Go to the control panel, and depending on the version of Windows you are on, you will either see an Icon that says Data Sources ...

74. Connecting To Database    coderanch.com

75. Connecting To Database    coderanch.com

Hello I'm having problems connecting to the databse via a java program. I'm using Win 98 and Oracle 9i Personal Edition. The database is on the same machine as the code. Accessing the data via SQL Plus works fine. The database is mounted and ready. I tried using the following program but get the error listed below. Do I need to ...

76. connecting to MS-Access    coderanch.com

77. Connecting to Access Database    coderanch.com

Odd. MS Access and the JDBC/ODBC bridge, eh? Great combination. No chance of using a proper database I don't suppose? Have you tried it with all the code for the SELECT part commented out? Maybe that's getting in the way. Your database is not in read-only mode or something, is it? Seems like a strange error message as INSERT/VALUES doesn't use ...

79. connecting java with plsql    coderanch.com

80. Connecting to Database in a jar file    coderanch.com

82. question regarding CONNECT BY    coderanch.com

Hi. I'm having problems using the CONNECT BY feature in oracle 9. I need to check which code is causing a loop between parent and child. In 10G I could use CONNECT_BY_ISCYCLE, but it is not available in 9i; so what I did was the following (if there's a better solution please let me know). parent_id | child_id 111 | 777 ...

83. Connecting to Navision    coderanch.com

84. Connecting to two different dbs in the same application    coderanch.com

Hello. I have a problem concerning connections to a database. I have an application that connects to a postgresql db, retrieves inforamtion which is processed an than used in a query to an oracle db, but when I try to connect to this db I get an SQLException saying that my oracle table isn't in my postgresql base. I have two ...

86. Help with "unable to connect to database" problem    coderanch.com

Hello All, Like many others I have gotten into the problem os unable to "connect to the database".I did look into the forums , but could not get a suitable answer. It would be great if someone helps me out in this very helpful forum.I am giving you the code I have so far written /*** DatabaseConnection.java****/ public class DatabaseConnection { ...

87. connect remotely to database    coderanch.com

88. Not able to connect my J2ee application to Firebird database    coderanch.com

Hi , I am using a database named Firebird 1.0.3 , Tomcat 4.1.27, Java - JDK1.4 My application is not able to connect to the firebird database . The entries made by me in the server.xml file of tomcat is userdbuser passwordanilpc driverClassName org.firebirdsql.jdbc.FBDriver driverName jdbc:firebirdsql:localhost:c:/fbsql/mydb.fdb where mydb.fdb is the firebird ...

91. Implementing START WITH, CONNECT BY Features    coderanch.com

I need to write code that works on Oracle and other databases - MSSQL for now. I need to scan thru a huge tree structure represented in table - self referencing table. For each node scans all the way up the hierarchy until the root node and do something on each node traversed. Now the problem. The table is huge, I ...

93. connecting database    coderanch.com

94. How to Connect to a Remote Database    coderanch.com

95. unable to connect to cloudscape    coderanch.com

Jeane, thanks! that helps. I have run into another problem when I try to execute the query against cloudscape. This query works fine in other databases like access but fails here. what's wrong? It seems like the ',' is causing some trouble. CREATE TABLE Users(lastName varchar,firstName varchar,userName varchar,password varchar,email varchar,gender varchar,adminPriv varchar,securityQuestion varchar,securityAnswer varchar,bDayYear varchar,bDayMonth varchar,bDayDate varchar,title varchar,organization varchar,address1 varchar,address2 varchar,city ...

96. Connecting to a Database    coderanch.com

97. Connecting to a database over the internet    coderanch.com

Hello , Ok heres an interesting question - I would like to have an applet running on my browser which needs to connect to a central server over the internet, which in turn will need to connect to a database and query some results. These results will be stored as flat files within the server. At the moment, I have an ...

98. How to connect the remote database over internet    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. - ...

99. Why cant connect to another computer in lan?    coderanch.com

Hi, In my Connect class, I can successfully connect to database in localhost, but failed to connect to another computer in the same lan. What's more my sql server 2000 enterprise manager can link to that computer's database server. My Connect class is as following. public class Connect{ private java.sql.Connection con = null; private final String url = "jdbc:microsoft:sqlserver://"; private final ...

100. Deployed App not connecting to Database    coderanch.com

Hi, I'm using this code to connect to an Oracle databse OracleDataSource ds = new OracleDataSource(); ds.setDriverType("thin"); ds.setServerName("dssw2k01"); ds.setPortNumber(1521); ds.setDatabaseName("orcl"); // sid ds.setUser("sss"); ds.setPassword("ppp"); Connection conn = ds.getConnection(); Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("select pwd from from dual where name='sss'"); if (rset.next()) System.out.println(rset.getString(1)); rset.close(); stmt.close(); conn.close(); When I run this program on my local machine, it works fine, and ...