jdbc 1 « Database « Java Database Q&A





1. jdbc: when can i close what    stackoverflow.com

currently i have jdbc code with the following basic stucture: get Connection (do the next 4 lines several times, never closing statement)
get statement
get result set
process result set
close result set ...

2. Database Migration    stackoverflow.com

I am working on database migration tool in java. The tool is copying database tables with their data's to the destination database. But i want it to work on different databases. ...

3. What is the best way to 'ping' a database via JDBC?    stackoverflow.com

I'm trying to determine the best way to ping a database via JDBC. By 'best' I mean fast and low overhead. For example, I've considered executing this:

"SELECT 1 FROM DUAL"
but I ...

4. Crystal Report DB authentication in java    stackoverflow.com

Dear All, I'm facing a problem in Crystal Report with Eclipse. I am using a servlet to render the crystal report viewer by writing the viewer object to the response like:

public class ReportViewer ...

5. How to simulate a DB for testing (Java)?    stackoverflow.com

I'm programming in Java and my applications are making a lot of use of DB. Hence, it is important for me to be able to test my DB usage easily.
What ...

6. Remove boilerplate from db code    stackoverflow.com

It seems that every time I want to perform a db query, I have to write the following:

Connection conn = null;
Statement stmt = null;
ResultSet rset = null;

try {
    ...

7. What is the best database to use with a java program?    stackoverflow.com

I've been struggling to get a Java program to connect to MS SQL Server, and I'm starting to wonder if MySQL would be a better choice for my (learning) project. Sun's tutorials ...

8. appfuse: should I configure jdbc credentials twice?    stackoverflow.com

New to appfuse - I like the concept. I configured the username/password to the database in jdbc.properties. It didn't work. So I also configured my credentials in pom.xml Why is it so? Am I ...

9. DDLUtils and autoincrement values    stackoverflow.com

When trying to use DDLUtils it always seems to take over the id values for the columns that are set to autoincrement. How can I prevent this? For example, I ...





10. jdbc to access complete database    stackoverflow.com

i want what should be given in DriverManager.getConnection() when i want to access all tables from ms-access

11. Accessing Unicode telugu text from Ms-Access Database in Java    stackoverflow.com

I have an MS-Access database ( A English-telugu Dictionary database) which contains a table storing English words and telugu meanings. I am writing a dictionary program in Java which queries the database ...

12. How can I access an Interbase (.IB) database using pure JDBC?    stackoverflow.com

I have a .IB file which I'd like to access using a Java Application. Where can I find the drivers for Interbase. My OS is Mac OS X

13. When to shut down message processing in case of queue / database failure?    stackoverflow.com

This is more of a best practice question for the common case of an application receiving messages, persisting them to a database, and possibly sending messages as a result.

  • Assume transactionality sorts ...

14. what databases can be used with java?    stackoverflow.com

I am doing an undergrad final project, and need to justify my choice of MySQL for the database element of my project. Truth is, it's the only one I can ...

15. Can I and should I use Eclipselink for non OR database interactions?    stackoverflow.com

We are using Eclipselink for ORM, but we have a need for some more lightweight database interactions that are more equivalent to JDBC. My question is whether Eclipselink supports such an ...

16. create object output stream from an object    stackoverflow.com

I want to create on ObjectOutputStream, but I don't want to persist the object in a file, so how to do that? All the tutorials(that I found) say only about the ...





17. how to check for duplicate entries in database?    stackoverflow.com

I need to apply a check so that a user cannot register using an email id which already exists in the database.

18. The topics that should be covered for learning JDBC    stackoverflow.com

I have been asked to learn JDBC. I do not know where to start. I have started with some books. It's using some SQL tables (I am also new to SQL). ...

19. OSGi bundle starting problem    stackoverflow.com

I have a Java application. I created a OSGi bundle and in Activator.start i added MyMain Class.main() .Application started but it have a problem with DB connection. 'java.sql.SQLException: An attempt ...

20. get all indexes declared in database from java    stackoverflow.com

Is there any standard java api that returns the indexes declared in the database. I tried using the getIndexInfo() in database meta data but that seems to expect a table name ...

21. How do I monitor a database for new entries?    stackoverflow.com

I have an application solution which is made up of a web app written in Python (using Django framework) and a Java application which runs on the server. The web application ...

22. Java embedded DB which does not require JDBC    stackoverflow.com

I have the following requirements:

  1. Keeping a list of users on disk for future loading. Each user has maybe 3 or 4 properties. Dozens to hundreds of users is typical, thousands of ...

23. Can commits be automatically collected into a batch?    stackoverflow.com

Is there a way to automatically put multiple updates into batches? For example, transform this program:

PreparedStatement prepStmt = con.prepareStatement("UPDATE DEPT SET MGRNO=? WHERE DEPTNO=?");        ...

24. Does JDBC set the database session time zone to that of the Java virtual machine?    stackoverflow.com

According to the JDBC 4.0 Specification, does JDBC set the database session time zone to that of the Java virtual machine (i.e. TimeZone#getDefault())?

25. What's the best way to read a UDT from a database with Java?    stackoverflow.com

I thought I knew everything about UDTs and JDBC until someone on SO pointed out some details of the Javadoc of java.sql.SQLInput and java.sql.SQLData JavaDoc to ...

26. Personal project in Java, how to approach the database access?    stackoverflow.com

My first project in java is going to be a program (eventually I have to create a GUI interface but for now CLI would do) to keep track of my books ...

27. Caching considerations for JDBC and Java    stackoverflow.com

I am having troubles deciding what cache solution should i choose for database objects from a remote db, accesed using JDBC. Since i have limited experience in the field, and a ...

28. Use Database in java application    stackoverflow.com

I am beginner in Java application programming. I've created a database application in Java. I use an MS access database with the JDBC-ODBC driver. My application's create-connection code is ...

29. Application wont write to MS DB    stackoverflow.com

I have created a Java desktop application which reads and should write to a Microsoft Access DB. The application works fine before I convert it to a .JAR after which it ...

30. count a value in database    stackoverflow.com

How I can count how many times a value appear in a table using jdbc? I have 200 possible values and 4 columns for records in the table.

31. Superlight database or MultiValueMap on disk rather than RAM?    stackoverflow.com

I have to store pairs like {long key, long value} and there could be multiple values per one key. I need to effectively enumerate keys and effectively search for values for ...

32. Setting up Firebird for remote Access with JDBC    stackoverflow.com

I have installed Firebird 2.5 on my Ubuntu 10.10 server for some testing. However somewhere I have gone wrong, I am looking for the way in which I create a new ...

33. lightweight database for Java with simple way to distribute    stackoverflow.com

I am developing a Java app. Users will download the jar and run it. It is currently using a mysql database for my development. To deploy it, I would require users ...

34. JDBC in makefile    stackoverflow.com

I'm trying to write a makefile for a java project as below. I have a database connected (installed and tested working when I compile with another IDE instead of javac). ...

35. tool to know if its n/w problem or the db issue which causing delay    stackoverflow.com

I have an application which has some intensive db operation at some point, along with writing blobs. Some time it takes a a lot of time. Is there a tool which ...

36. Why won't my Java Class write to a database?    stackoverflow.com

I'm having trouble getting Java to write to a database. I have the following code that compiles and runs with no errors.

import java.sql.*;
import java.lang.reflect.*;
import java.lang.reflect.Array;

public class InquireRecord {

    ...

37. Concurrent access using JDBC in Java    stackoverflow.com

I'm developing a Java Desktop Application using JDBC, and I wanted to manage the concurrent access to the Database. Someone told me to use Sessions but after some research it turned ...

38. JDBC compatible Main Memory Standalone database    stackoverflow.com

I need a high performance main memory database for my Java Application 1] Please suggest the database which is
-JDBC compliant
-Standalone(i.e. Flat-File)
...

39. Apache-Mina FTPServer Database User Manager failure    stackoverflow.com

I'm attempting to set up a windows-based FTP server using Apache FTPServer, however I keep running into the same issue whenever I use db-user-manager as opposed to the file-user-manager. We have ...

40. JDBC over SSL to a Cache database    stackoverflow.com

I'm pretty far out of my depth here, so bear with me. We're using JDBC via com.intersys.jdbc.cachedriver to run stored procedures in Intersystems Cache and get the results in Java. However, ...

41. Weblogic set JDBC Shared    stackoverflow.com

I'm using Weblogic and I set a JDBC driver to allow a service to get a connection to the db.
This DB is also reachable by other clients for other purposes.
What ...

42. One-way per-table syncing for DBs (like rsync over JDBC)    stackoverflow.com

It would be really nice to be able to have local mirrored copies of tables from external DBs, for analytics purposes, running batchjobs and so on. With files similar tasks can ...

43. Share database in java    stackoverflow.com

what would be best method to share a database in Java (I have 2 computers connected via lan), both are windows xp

44. How do you set up multiple JDBC database pools in Adobe/Day CQ5?    stackoverflow.com

Using Adobe (Day) Communique 5, I've been using the standard JDBC Connections Pool service for my first database, and it works well. Now I need to configure more connection pools for ...

45. Get URL of Solid DataBase for JDBC    stackoverflow.com

I have a Solid Database. And I want to connect to this DB by JDBC. How can I get URL for connection creation? [EDIT] For more information: SOLID JDBC Driver Programmer's Guide

46. A simple client-middleware simulation with JDBC    stackoverflow.com

I'm trying to implement a simple client-middleware-database architecture, where the client send the request to the middleware, then executes it on the database and finally returns the answer to the client. ...

47. J2SE and Database Access    stackoverflow.com

Hi. I am writing a standalone java app, and I want to access a database for persistance, but I couldn't find a good tutorial on what to use, and, the current ...

48. Using XA with databases that don't support it natively?    stackoverflow.com

Is there an open-source Java library that adds XA support to databases that don't support it natively? That is, it wraps a non-XA JDBC datasource and takes care of the necessary ...

49. How to pass db ip as a var for jdbc con. through cmnd line    jmeter.512774.n5.nabble.com

Hello All, I am having problems passing in the db ip value as an arg through command line. I am using jmeter 2.1.1 The JDBC Connection Config has the following (and works fine if the ip address is hardcoded in the "user defined variables" config element placed above this jdbc connection) ...

50. want toknow all the object names in a database    coderanch.com

hi friends, what all i want is what query should i fire to get all the object names like tables,vies etc in a database. in oracle it is "select * from cat" or "select * from tab" but I want to know the exact query for MS-access or SQL-server. thanks in advance.

51. Database Synchronization...    coderanch.com

Hi all, I'm not sure whether this is the right forum to place this problem. I have developed a mail management system. In this the mail coming from the customer can be routed to different agents(employees), by the mail administrator(or by some service). Agents have to give reply to these mails. So customer emails will be routed to the different agents. ...

52. database metadata    coderanch.com

53. database operation with other character set    coderanch.com

I am chinese guy, and my OS(WinNT4) is a Simple Chinese version, so the default zone is Chinese(RPC). Now, I wanna to insert a record into database(MS SQL7.0), the value is a chinese word delivered by a variable. but ODBC always return error, and most situation the error message is 'error syntax' near xxxx(chinese word). how can I do it. whether ...

54. Database Abstract Factory    coderanch.com

We want our product to support multiple databases, but there are some issues. For example, different database vendors tend to store dates differently. We would want to make our core code as database independent as possible. I'm thinking we need some type of database abstract factory. I realize JDBC does this to some extent, but from what I know, it seems ...

55. Database ...need to implement    coderanch.com

HI Everybody, I am working on a project which is basically a client side application (applet using cardlayout). See i have few textfields in which the user can put in his data and at the end of the last step he has the option to SAVE, PRINT & ORDER. When he says SAVE then it should print on the client side ...

56. how to deploy database on site??    coderanch.com

58. Legacy Databases and JDBC    coderanch.com

59. java interface to DB on winCE    coderanch.com

60. Database Design    coderanch.com

My question really isn't Java specific but I couldn't think of a better place to discuss it so here goes. Let me give you a quick idea of what I'm working on and then my basic questions and known options. Then any advice or comments would be appreciated. The application (front end is JSP) must store and retrieve information about chemical ...

61. Calculating the enteries of the database    coderanch.com

I have made a project on Inventory Control System. I have given two options ie an inward listing & issued listing.Whenever I make an entry in the inward list it gets added in the database but incase of similar entry the change in the quantity of the item should be at the same place where the earlier entry was made. Similarly, ...

62. General Database Question    coderanch.com

I am new to database programming and I was curious on exactly what SQL Server does as opposed to access. Does SQL Server store all of the records itself, or is it merely an engine to manipulate a database. If someone could give me a general overview of what SQL server does, it would be a big help. Thanks.

63. Legacy Databases    coderanch.com

Franck, You are right, there definitely are JDBC drivers for DB2. I don't know about the 390s, but for the AS/400 there are even 'Native' java drivers. Personally, I want to avoid the Native drivers because anything written with them would not be platform independent but they do exist. Just FYI, Joel ------------------ I'm a soldier in the NetScape Wars... Joel ...

64. OO Databases    coderanch.com

66. Creating a database    coderanch.com

I am new to Java.My Question is I want to create a database instead of querrying a database. What I want to do is I have a list of create statements in a text file Is there anyway by which I can connect to database server and execute these create table statements in my text file. Example Database.txt is my file ...

67. How to handle concurrent write/read to a db    coderanch.com

Hi all, in my application i have two databases. lets call them a & b.from database a i will be just reading data and displaying it to the user.no writing has to be done.but on database b i have to perform writing as well as reading operations.since multiple users will be accessing this database i have a few questions i) how ...

68. Btrieve DataBase    coderanch.com

70. Database Setup    coderanch.com

Hello, I am planning on setting up a database server. I am wondering what the best solution maybe. This going to be very small scale running on a P200 /w 128meg, and i am planning on only about 50 user hits a day. I have some idea of my options: -BSD/unix, win2k/XP RC1 -mySQL, oracle -tomcat, iSuites I do have unix ...

71. multiple databases single webserver    coderanch.com

73. Passing NULL to the database    coderanch.com

74. Synchronizing two databases.    coderanch.com

75. Read-only, embedded database    coderanch.com

My application reads (doesn't write) a few tables from a database, using JDBC for simple queries and a little MetaData retrieval. But, now I need to distribute the application to others, and I want: 1) trivial setup for them (e.g., no separate install of a database product) 2) hidden database data (I don't need top level security, but I at least ...

76. Any free online Databases on the Web?    coderanch.com

77. experience with databases and jdbc-drivers    coderanch.com

hi all, I'd like to know if someone has experience with the postgresql, mysql, sybase, oracle managing _lots_ of data or with database access both using java and perl. for the task (I am looking for a solution), most of the time the data will be selected one row at a time (certainly using an index). on the other hand, it ...

78. an access database problem    coderanch.com

hi guys, it's my first time here, and i'd like to know if someone has met that error?? count field incorrect with an ms-access db using preparedStatement. here it is: String get="SELECT * FROM FAQS WHERE ID=?"; String put="INSERT INTO FAQS VALUES (?, ?, ?, ?)"; //String put="INSERT INTO FAQS VALUES (NEXTVAL('faqid_seq'), ?, ?, ?)"; String rem="DELETE FROM FAQS WHERE ID=?"; ...

79. Database escape char.    coderanch.com

80. Write to DB immediately before cnn.close()    coderanch.com

Hi, I am using the jdbcodbc bridge with an Access DB. My main connection class is a static class, which is used by all other classes for db interaction. It all works fine, but when I perform a DB INSERT/UPDATE, the results do NOT get written to the DB until I explicitly call conn.close() In my case, this may not happen ...

81. Storing Picture in Access DataBase    coderanch.com

Hello I am Working in Java, and using Microsoft Access 97 as a Database. I want to Store a picture or any object in Database as an Object. I am using Datatype for it as a OLE Object in Access. But I am unable to store Image in My File and Get it(Select it). Can you tell me how to do ...

82. Memory mapped database    coderanch.com

Is there software out there which will query the database, retrieve the data in a memory mapped structure that mimics the underlying table structure, so that when I run the SQL it runs on this memory mapped structure. I don't want object-relational mapping tools that map database to objects but a tool that is just a memory map of the underlying ...

84. Lotus Notes DB    coderanch.com

I am trying to query some data out of a Lotus Notes DB and no I do not know the layout and trying to the person that created it in my company is a joke. So my question for one is how come when I see that the field name is say "FirstName" and I type that in rec.getString("FirstName") i get ...

85. From MS EXCEL to the Database -- is it possible?    coderanch.com

1)I have done this easily: query an Oracle or whatever database and present the data in MS Excel format to the client. ps. and we all know we can save this to hard disk as a flat file -- super duper easy program which we can write with our eyes closed. 2)This is my problem: from a client in MS Excel ...

86. Databases    coderanch.com

87. Database Access Design    coderanch.com

I'm writing a web application that accesses a PostgreSQL database using JDBC. My code works fine and my application runs (mostly) smoothly, but I'm wondering if I have the best database access design. This is what I'm doing now. I have created database accessor classes for each table in the database that I want to access. I've attempted to make the ...

88. What is the best database software for developing with?    coderanch.com

If you want to run the DB on the Windows box, your options are going to be limited. Last I checked, MySQL can be compiled for Windows but must be licensed in that case (their valid argument is that they can get UNIX development tools for free, but have to pay for the Windows tools, so they have to charge a ...

90. Database backup to local system    coderanch.com

HI Ranchers, I would like some help and fast, i need an application that would connect to my SQL server database on the web and make an incremental database copy of that to my local machine in MS Access periodically. Please let me know on how to go about it as this is very urgent and i am really stuck. Pleae ...

91. Database Reports ???    coderanch.com

92. Java Database book    coderanch.com

93. How can I copy my database?    coderanch.com

94. how can i lock database programmatically?    coderanch.com

I could be mistaken, but I don't believe java has a built in mechanism that will lock a database from access. There are utilites that will allow you to control the type of transaction that can occur on the database(read-only, dirty reads etc.). But I believe you may have to build your own database locking mechanism. Creating a locking mechanism at ...

95. Reconnecting to the Database    coderanch.com

96. Help a beginner create a database! ;-)    coderanch.com

My problem is that I need my java program to create this database in run time... Don't know if this is even possible. Since a connection object needs an existing database to connect to, you can't use a connection if it doesn't exist. So although you may be able to make some sort of system call outside java, there is no ...

97. strange!! if not close, database not show ??    coderanch.com

hi all, I am using "sun.jdbc.odbc.JdbcOdbcDriver" doing a testing project using Access 2000 as the database. I run into a strange scenario: try{ con=DBUtil.getConnection(); Item it = new Item(con2); // some insert statement here con.commit(); //this line not work either!! }catch (Exception e){ e.printStackTrace(); }finally{ try{ if (con2!=null){ con2.close();// if I comment out this line, database not show the change at ...

98. Small database    coderanch.com

99. database url explanation?    coderanch.com

You should be able to get them from your DBA. and if they already have a DNS name for the server you can use that instead of the IP address. Port 1521 is the default, so if they use that, that is what it is. Mark [ May 16, 2002: Message edited by: Mark Spritzler ]

100. Database question???    coderanch.com