jdbc 2 « Database « Java Database Q&A





1. db method return type: object array or Vector?    coderanch.com

i have a method that needs to return a collection of objects, say Customers. each row of a table represents the fields of the Customer object. performancewise, is it better to have the method return an array of Customers (ie Customer[]) or a java.util.List/java.util.Vector containing Customer objects? I personally like the method returning Customer[] because it makes a cleaner method signature. ...

2. DB Development Tools (DB2/OS390)?    coderanch.com

4. Synchronizing Databases    coderanch.com

Does anyone have any suggestions for keeping my local database synchronized with the database on my server? I'm using mySQL and I find myself re-entering data on the server to keep it in sync with my local development database. I have tried exporting/importing data, but this is a hassle and I sometimes get errors doing this. How do people generally handle ...

5. General Database Question    coderanch.com

6. create database using jdbc    coderanch.com

7. Advise on Freeware database for Java    coderanch.com

8. Creating Catalogs or Database    coderanch.com

9. Wanted: Commentary on Favorite low $ Databases    coderanch.com

Where is there a list of low $ cost databases? MySQL, MSQL, Sonic, Cloudscape, PostgreSQL and MSAccess would be a few. I had never heard of Sonic before -- but I discovered it was bundled with JBOSS. I'd love to see a chart comparing all of them and their features. There must be one on the web somewhere. I'm trying to ...





10. API to create databases?    coderanch.com

11. Batch DB Updatation    coderanch.com

Hi Guys !!! Below is a piece of code: try{ con.setAutoCommit(false); Statement stmt = con.createStatement(); while(stToken.hasMoreElements()) stmt.addBatch(stToken.nextToken()); int[] updateCounts = stmt.executeBatch(); con.commit(); catch(BatchUpdateException bueExcep){} Here, batch updations take place dynamically through a user interface wherein the user casn specify the sql scripts to be fired. However, for instance if the first sql script is correct but the ones later on are ...

12. help, backup database??    coderanch.com

13. message board database design    coderanch.com

14. Get a char out of a db    coderanch.com

Anthony, just like Larry Jones replied before, use String. String tempCitiesServed = rs.getString("ALL_CITIES_SERVED_FLG"); if (tempCitiesServed != null) { demo.setAllCitiesServed(tempCitiesServed.charAt(0)); } else { demo.setAllCitiesServed(null); } This handles the String and null values as well. However it does not handle empty String's. I know DB2 will return a String with blanks instead of an empty String for CHAR colums, if they are not ...

15. Database Metadata    coderanch.com

16. adding text to a database    coderanch.com





17. Add/Modify db methods in a bean    coderanch.com

Ok I am writign an application that has a form on it that you can create or modify a record. Currently, When you bring up a pre-populated form I delete all the info that was listed in the db for where the form datd would be stored than use this new information to repopulate these fields? I really did not wnat ...

18. How to create a Database?    coderanch.com

Hello all, I've created a table with code, I want to know if it's possible to create alsoe the database instance from java or do I have to go to access and and create a file .mdb? This code works properly if the database instance is already created. I would like to check if the database exists and if it doesn't, ...

19. A question about JDBC database access    coderanch.com

20. URGENT !!! DATABASE POOLING    coderanch.com

I've just configured database pooling in tomcat 4.1 JDK1.4 LE using commons-DBCP and it is working fine. Earlier i was using bitmechanic pooling mechanism in my application. Here comes my problem in my code i was using the same connection object for creating more than one prepared statment objects and it was working fine. say Connection con = null; PreparedStatement pst ...

22. Database not found ...    coderanch.com

24. Microsoft Project Database in Java    coderanch.com

25. database url    coderanch.com

26. Null Returns From DataBase    coderanch.com

I am having a Problem With JSQLConnect If the DataBase Column in Null The JSQLCONNECT.jar trail Version is Not Giveing ANy error. If i am Using Licensed Version It gives the Error. The Query I have used is Select Sum(A), sum(b), sum(c) from TabA Group By a,b,c Sum(A) will return Null Any Clue

27. Help needed on setting up a database    coderanch.com

28. Lightweight Database Recommendation Anyone?    coderanch.com

Hi, Does anyone have a recommendation for a light-weight database. I don't really need the full-on features of SQL Server and as I'm building a desktop application, I don't want the weight either. Is there something like MS Access that I should know about. I don't need the coding features in Access, just the tables. As I come from a Microsoft ...

29. Database lookup at a particular time?    coderanch.com

30. JDBC/Access DB basics    coderanch.com

31. Instant DB , to_number function    coderanch.com

Hi, I was working with the instant DB , and was in need of a query which will sort a field of a table in ascending order.the field type is character,but contains numeric values(1,2,3etc).so said like select * from table_name order by to_number(field_name) , it raises an error that to_number is applicable to date fields.can this problem be solved , if ...

32. Very Basic Database    coderanch.com

To create a database, you firstly need to decide which kind? From large to small in scale, you have: Oracle > MS Sql > MS Access ..... With Access, you don't need to know SQL. Anyway, the first step for you is to decide what kind of access you have to Database. Then play with it.

33. Putting JMS Queues into a database    coderanch.com

Mark, it's not clear to me what you want to achieve. Do you want your queue to be backed by the Oracle database? That is usually fairly straightforward, but depends on your JMS implementation. Or do you want to serialize your queue as a whole, contents and all? That might never work unless your JMS implementation was designed with this in ...

34. Which DB would you use?    coderanch.com

The type of info I will be storing is the state of an application when closed i.e was check box X selected. I will also be storing info about some of the data we work with. Client X's member datas values etc... This has to run on Windows, Linux, and Netware at a minimum. I am thinking about using MySQL but ...

35. Creating a DB Framework    coderanch.com

I am working on Creating a DB Framework for Read Only Information and i would like to share some of the points that could be really helpful which have come up from the 3 days of research that i have put into it thus far.......I hope the next week and a half will yield even more information............... I would really appreciate ...

36. Please Help!!! Generic Database Access Class    coderanch.com

Hi, I am developing an application in java which will query and update/delete from a database (I am currently using an Access database for a prototype). The problem I have got is that I have a database schema which has relations such as - 'one client to many products'. E.g - I have got a client table and a product table ...

37. Generic Database Class    coderanch.com

Hi, I am developing an application in java which will query and update/delete from a database (I am currently using an Access database for a prototype). The problem I have got is that I have a database schema which has relations such as - 'one client to many products'. E.g - I have got a client table and a product table ...

38. Looking for a database to Java code generator    coderanch.com

I'm looking for something that would mash some code into my build. Suppose I had a table called "Employee" and it had three columns: EmployeeID (int not null), EmployeeName (varchar(80) null) and SupervisorEmployeeID (int null). I would like to run a program that would generate a class called EmployeeRecord that would have the attributes int employeeID ; String employeeName ; Integer ...

39. Store Java Object in Database    coderanch.com

40. post relational database    coderanch.com

41. How do you DB?    coderanch.com

42. Java and database    coderanch.com

You need a '+' after the start variable on the query line. As a side issue the SQL Insert statement will fail if anyone adds a new column to the table. Try using the following syntax that expilcity names the columns instead: INSERT into TABLE1 (COL1, COL2, COL3) VALUES (VALUE1, VALUE2, VALUE3) I tend to use PreparedStatements rather than all of ...

43. database can not be accessed -- Please help !    coderanch.com

Hi, there I encountered a quite strang problem with my table in oracle. I have a process to write to a database all the time. And also I have a cron process to read from this table once a day at 00:11:00. But every midnight around 00:01:40, first process starts to throw me exception saying can't update the table and repeats ...

44. What can I do to pre-select something from database?    coderanch.com

I find there is a "Oracle" group but I am not using Oracle at all. So I am posting this here. Hope you can help. I am new to stored procedure and new to Java's "PreparedStatement/CallableStatement". What I have done before is just straightforward java sql "Statatement". So I need your input here --- In my first page, I let user ...

45. Can I write the object to Database    coderanch.com

46. Suitable Database    coderanch.com

All my data are going to be articles with graphs and tabulations in Excel format. Each article is associated with an author. The web site is designed to receive articles and store them in a database. Later on, some of the articles will be viewed on-line in a style like those papers in professional journals. Are relational databases such as MySQL ...

47. Different Execution Plans for 2 instances of the same database.. Why??.. Help me out    coderanch.com

Hello all, I have a problem with Execution Plan Here I have a SQL query, which I am running on 2 databases. The 2 databases are same snapshots but at different locations. The local database ( database which is on local server ) is giving different SQL Execution planand the remote database is giving different execution plan. All the init.ora parameters ...

48. Advice of database type is needed    coderanch.com

49. I Need DB    coderanch.com

50. Jenny the db code Generator    coderanch.com

At last some neat generator! thanks Just a tip for anyone using Jenny, If you are using MySQL, then it wont allow u to have "[NOLOCK]" in your select queries (at least the version 3.23 wont). So one needs to Edit DBQuery.java and comment out the line which appends "[NOLOCK]" to the query, and recompile it. Then it will work fine ...

51. Jenny the database code Generator FAQ    coderanch.com

52. newbie question on database    coderanch.com

Dear all, This is the first time that my boss ask me to create a table to store some customer's records. Each customer should have a unique ID as the primary key. My question is that how should i create a table which generate a new customer ID each time when a new record is add?? Thanks

53. getting a database model    coderanch.com

hi, Is there a way I can get a full ERM model of my database when using mysql? I am used to working to access so have always been able to see what my databse looks like and would very much like to be able to continue this. Are there maybe applications which can create the view for me using my ...

54. DB constraints and composite primary keys    coderanch.com

I have two questions about JDO: 1) I have constaints created in my tables to restrict the values that go into the fields. For example, I made a "boolean" value in MySQL to be a tiny int that can only have the values 0 or 1. Does the JDO spec take that into consideration when an existing database is being reversed ...

55. JDO or Object Databases..?    coderanch.com

I think JDO will have exactly the opposite effect on object databases. Before JDO, a programmer who chose to use an object database on a project was challenged by management and peers to justify the risk that the company would be out of business and another incompatible programming interface would have to take over. What JDO allows is to mitigate this ...

56. Object Databases    coderanch.com

I don't know what ESRI uses internally, though I am willing to bet they have built their own home-brewed database on top of the file system, to get the necessary performance they needed. They probably could/should have used an object database instead. You end up spending a LOT of time developing your own home-brewed database. I know, we did it all ...

57. Jenny the db code Generator    coderanch.com

I was wondering if there was a way to limit the tables that Jenny tries to generate classes for. When I run it against an Oracle user it seems to be trying to generate java classes for *all* tables for a user including system tables. Quite a few of the tables have characters that Jenny doesn't like. For instance: *** XDB$ACL ...

58. Storing Socket object in database    coderanch.com

HI Is it possible to store a Socket Object in the database(MySql) which can be retrieved later when required. when the server accpets a connection , it spawns a new socket for each connection so that the required input/output stream can be opened . Now i want to store this socket object and mantain a list so that when a pirticular ...

59. Is there a way for a database to notify it’s JDBC clients of a change?    coderanch.com

Is there a way for a database to notify its JDBC clients of a change? I have a database with multiple application clients (multiple web servers, desktop applications, etc) each connecting to a single database through JDBC. Each of these clients cache the information as they retrieve it to aid in performance. What is the best way to ensure that the ...

60. What makes database access slow? (general question)    coderanch.com

Databases are my weakest area. I know how to make use of them, but not really how to use them optimally. On my current project, we're running Oracle 9i on a high end desktop server. We're trying to write approximately 1000 rows to the table per second each and every second. It's very slow. Now I know that many operations achieve ...

61. new to database question    coderanch.com

Hi, everyone. I am quite new to database programming, I don't know which database system should I choose to practice and which one is most marketable used. There exits several choices as: Oracle, mySQL, MS SQL Server (is it also syBase?), MS Access and DB2. Could someone give me some advice or just tell me about the difference of these systems. ...

62. 1-tier database    coderanch.com

63. Database locks    coderanch.com

I am using a DB2 database. Currently our users are using an application we have put out to them for our order entry system. After a couple of weeks, we noticed there were a couple of times our backup didn't finish due to some tables that still had a lock held on them. After doing a bit of searching, we found ...

64. Need a database on DOS    coderanch.com

65. JDBC start/stop database needed    coderanch.com

Solaris 2.8 Hardware Sun Microsystems Oracle 8.1.6 Java 1.4 Oracle JDBC class111.zip I have a Java application that creates a JDBC connection to Oracle database and queries a table called foo, printing out the values. The table has three columns. I the do the following: 1. I close the resultset and statement, etc. and terminate the program. 2. I go into ...

66. select works in db, but not across jdbc...    coderanch.com

Its that wacky ODBC driver that you are using. You are using "sun.jdbc.odbc.JdbcOdbcDriver" for your Jdbc Driver (and jdbc dbc: for your url...). Use the Microsoft SQL Server jdbc driver. The sun odbc driver doesn't conform to a lot of stuff... Example - the executeQuery() method throws an exception when no rows are returned, even though it should return an empty ...

67. JDBC - Remote DB    coderanch.com

68. about database    coderanch.com

69. Creating my own database locking mechanism from my app - how?    coderanch.com

Hi, i have a problem that i do not think can be solved ( given the limitations by my superiors). I just though that it would be good to see what other people thought before i told them i could not do it. I was told to write an app that called a db2 database and retreived a large result set ...

70. passing value from database to an array    coderanch.com

Hi, I've got a problem to pass values from database to an array. I retrieved values from the database using while (rs.next()), then I want to pass all the values to an array. The problem is I will get the looping array that depends on the values i've got from database. Let say i've got 10 values then i will get ...

72. To store files/images in a database or not    coderanch.com

Hi, This is probably one of those questions that spans a couple of saloon's. I am constructing a web application, using MVC servlets, jsps and mySQL, to store articles and images. Users of the website are allowed upload images and word documents. I'm wondering what is received wisdom regarding storage. Is it best to upload these files to a directory and ...

73. Java enabled FREE web sites with DB access    coderanch.com

I really new to this message board and JAVA. I'm looking for a free web hosting site that will let me test my Java pages. It would be nice if they offered a free database. I'm wokring on a Java project that will use a DB as a backend and run code against it to produce reports. I know ASP, VB ...

74. integrating a web application with a database    coderanch.com

OS=Windows98, Tomcat v. 4.1.27.exe, J2SE/JDK v. 1.3.1 contents of AUTOEXEC.BAT: set PATH=c:\jdk1.3.1\bin;%PATH% set CLASSPATH=%CLASSPATH%;.;c:\ServletDevel;c:\Tomcat\common\lib\servlet.jar set JAVA_HOME=c:\jdk1.3.1 I'm new to servlets. I want to know how this integrating web applications with databases done. What is that web container that should be installed in my PC? And what is that database management system that should be installed in my PC? Below are tasks ...

75. getting html output stored in database    coderanch.com

this is the table html2long with the fields. BP_IDENT ------------------------------------------ BP_DATA ----------
106 My code : import java.sql.*; import java.io.*; class Long2Html { public static void main (String args []) throws SQLException, ClassNotFoundException, IOException { // load the Oracle driver Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection("jdbc :-o dbc:calvin","scott","tiger"); Statement stmt=conn.createStatement(); // query to get the row with bpdata 106 ResultSet ...

76. How to run database specific calls via jdbc?    coderanch.com

JDBC allows you to throw any string at the DB that you can, including database specific sql/dml. So if the database can execute the command ( proprietary of not ) it will. If it is DML or an update of some kind, use statement.executeUpdate( sql )just like you would a standard SQL92 query. There are no limitations on what can be ...

77. What is database lenght?    coderanch.com

78. What is Database Length?    coderanch.com

79. your opinion of the most important part of database-based developing?    coderanch.com

More specifically, understanding the data structures associated with that business and designing the database correctly. Understanding the concept of database normalization is an important part of designing a database, and it is even more important to understand when you should "de-normalize" portions of your database. (This is not often recommended, but sometimes the business just doesn't do business in a fully-normalized ...

80. cannot activate a web application with database    coderanch.com

The topic is Integrating a Web Application With a Database Below are softwares installed in my PC: OS=Windows98 Tomcat v. 4.1.27.exe J2SE/JDK v. 1.3.1 mysql mysql-connector-java Below is the content of Autoexec.bat: rem - By Windows Setup - C:\WINDOWS\COMMAND\MSCDEX /V /D:ATAPI_CD /M:10 set PATH=c:\jdk1.3.1\bin;%PATH% set CLASSPATH=%CLASSPATH%;.;c:\ServletDevel\database;c:\ServletDevel\database\lib\conn_pool.jar;c:\Tomcat\common\lib\servlet.jar;c:\mysql-connector-java\mysql-connector-java-3.0.9-stable-bin.jar set JAVA_HOME=c:\jdk1.3.1 Compilation of servlet files below were successful. InitializeConnectionPool.java ScrambleGameServlet.java NamingService.java ScrambleGameService.java Word.java WordCategory.java ...

81. No start database manager command was issued    coderanch.com

I am loading data on a UDB DB2 7.2.6 on a Sun Solaris enviornment and randomly getting an error below. If any one can help I would greatly appreciate it. Fatal : main - Unexpected error occured. Pack processing is terminated. Exception :COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1032N No start database manager command was issued. SQLSTATE=57019

82. client/server database?    coderanch.com

Hi! i was asked to make a simple client/server database application.. It only involves an ACCESS database... My question is what is really a client/server database application? 1. is a client/application like this: the client application runs on a particular mahcine on a network and then the DATABASE is on a seperate remote machine? and if thats enought i'll just make ...

83. db settings    coderanch.com

84. DB Normlization    coderanch.com

Normalization is the process of balancing the information stored in database tables so that information that does not have to be repeated isn't. For example, if you have a database an inventory and you have 100 items and 10,000 instances of the items you wouldn't make one table with 10,000 records, one for each item instance. You'd have 100 records representing ...

85. Huge database access    coderanch.com

Hi We are developing an integration software which basically integrates between one software(which collects alot of data(from various computer nodes in a network) and puts/updates in a database.Our part is to retrieve this data and put it into another Assetmaangement software through API.There is no problem when dataset is small i.e. say 25000 total records.What algorithms or techniques are used while ...

86. updation of database    coderanch.com

I am trying to update the table emp_details. I had written a html form for taking the input from the user, a jsp file for forwarding the request to a bean and a bean for updating a record of the emp_details table. When i test them in the server no error is coming. But the database is not updating.Here is the ...

88. Accessing a Microsoft Access Database    coderanch.com

Hi! Kevin..... here is ur step by step procedure to connect to an access DB... 1.) Create a system DSN for ur DataBase(*.mdb file) to learn how to do this u can go thru this WebSite: http://www.webwizguide.info/asp/tutorials/setting_up_dsn.asp 2.) In ur java code load the jdbc-odbc bridge driver in the following manner: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 3.) Create a connection using : String url = ...

89. accessing database ingres 6.4    coderanch.com

90. deleting from database(simple)    coderanch.com

Hi all, my site is in JSP + mySQL customer can join to the site through membership form. i want to remove a customer from my database if he is not purchasing any items within 7 days. how to achieve this?..i think this can be done with a database Trigger.but mySQL does'nt support Triggers.so what will be the possible solution?. this ...

92. Help please, getting info from Database    coderanch.com

Ok i have this method to get names from a database so i can put them in a combo box later. Here is my code for the method: public void getContacts(){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc dbc:email"; String userName=""; String PWD=""; con=DriverManager.getConnection(url, userName,PWD ); stat=con.createStatement(); rs=stat.executeQuery("SELECT * FROM contacts"); } catch(Exception ev){ JOptionPane.showMessageDialog(null,""+ev.getMessage()); }//end catch showRecord(rs); }//end getContacts public void ...

93. Agile Database - Java JDBC concerns    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. - ...

95. Multiple database instances and types    coderanch.com

96. Using any database.    coderanch.com

Hi all, I am attempting to write a Java application that could run on any database. But anyone who was worked with JDBC know this is not as easy as people make out. Diffrent database vendors support diffrent parts of the SQL standard. The application is not on application server so I can not use CMP or JDO. So I am ...

97. JDBC with database specific calls    coderanch.com

I have a query that involves database specific functions for sybase. One of them is getDate(). When I ran it on WIN-NT through Sun's jdbc-odbc bridge driver it worked like a charm. Now I have to port it to a unix based platform and will need to use J-connect (Sybase's driver) and with this driver the code is blowing up on ...

98. detect db locks    coderanch.com

99. failure to activate a Web application with database    coderanch.com

JavaRanch Java Forums Java JDBC Author failure to activate a Web application with database Cathy Valdez Greenhorn Joined: Oct 22, 2003 Posts: 23 posted Feb 21, 2004 12:05:00 0 I tried to activate an example Web application with database but failed. This example is done by: 1. Developing a servlet context listener to initialize connection pool and place ...

100. Beginning With Databases    coderanch.com

I would like to write a simple program that stores information in a database. Most references on Java Databases refer to "connecting" to a database. I imagine this database already exists and was perhaps created by another program altogether. Where do I start if I want to use a database in my program? What's the simplest technique to store data for ...