jdbc 4 « Database « Java Database Q&A





1. how can I know my database name?    coderanch.com

I can give you a hint, but I don't have Oracvle running locally to check. The database name is also in the s\ervice name, so if you're running oracle locally and it is running at the moment, open a command prompt a type 'net start'. This will list all of the running services. One of the oracle services will have a ...

2. Real life databases    coderanch.com

Hi Just wanted to know if anyone here has designed a commercial real life database which (part of it) is to do with storing usernames and password and other personal information. Do you keep all the data in the same table? i.e. UserID(P.K) username, password, email, firstname, lastname, city, etc... in just one table or do you separate the details into ...

3. Bottleneck in DB Tier    coderanch.com

I am connecting Tomcat to Oracle thru thin JDBC driver. The link between tomcat & oracle is now found to be the bottleneck - too many JDBC calls that could be handled by the network. What are the possible solutions I can use now? Some suggest to use Oracle Real Application Cluster (RAC) to scale the db tier. I am new ...

4. Which Database to Use ?    coderanch.com

I think you should consider money and power before deciding on your database. Some databases are definitely more expensive then others whereas some allow a lot more power, especially in distributed computing. For example, Oracle is usually more expensive than SQL Server, but often more powerful (although I haven't checked pricing and new features lately so this could be out of ...

5. Advice on Database modeling ?    coderanch.com

6. Regarding DB Link    coderanch.com

7. Proper place to initiate DB Pooling    coderanch.com

private DBBroker() { init(); } private void init() { logger = Logger.getLogger(this.getClass().getName()); try { InitialContext ctx = new InitialContext(); ds = (DataSource) ctx.lookup("java:/testDS"); } catch(Exception e) { logger.error(e); } } public static synchronized DBBroker getHandle() { if(broker == null) { broker = new DBBroker(); } return broker; } public synchronized Connection getConnection() throws Exception { return ds.getConnection(); }

8. Help on Database Design    coderanch.com

Hi guys, I don't know where place this question... But I'm posting it anyway coz I'm in a real hurry... Well... I'm a doing an inventory system - like application... It functions a little different though... Now I categorize my items as Hardware/Software/References. You get the picture? This is an inventory system for an IT department. I need to design my ...

9. Regarding Database Transction sychronisation    coderanch.com

Hi All, Wish you happy New Year!!! My scenario is: I have a form to enter master records. The Material Id is the element in that form. The value should be retrieved from the database. Get the latest value from the data base and increment it by 1. The ID should start with 0001.So for the second id it is 0002. ...





10. Using database roles in a J2EE application    coderanch.com

I would say no, they are not used much these days to provide user-level security although there may be people out there who still use them to a large degree. Usually DB roles are too limited in functionality to be used in any great degree so most db systems I have worked on use the same set of username/passwords for all ...

11. getting null values from DB    coderanch.com

12. Multimedia databases    coderanch.com

13. common utility class that use for database    coderanch.com

You should look at an Object-to-Relational mapping tool. Hibernate is popular at the moment, Castor and Toplink have been popular before that. There are aothers to look at too. These tools perform database operations for you and manage all database operations and automatically map them to Java objects, so you don't have to do anywhere as near as much work.

14. how to select database    coderanch.com

hey Usually I predefine the location of the database in the in the bean file . But currently I want to select the user to select the database . I it possible to define the database location in the bean file based on option availble in combo box. please replay me soon .thank you

15. Displaying Greek values read from Database    coderanch.com

Hi Friends, I have a problem in dispalying Greek values. I am using SQL Server database. And in one of the tables i am having greek values. In the table i can see the value appearing in greek language, but when i dispaly it on my console i am getting the values as ???. This is my code, can anybody please ...

16. Access database issue.    coderanch.com

I don't know if this is the exact place for this q, but I am trying anyway. I have a access database table of say a million and a half records. I have an excel file of say 25000 records. the excel file has customer list with their phone numbers, the access table has do not call list of numbers. I ...





17. Identifying Database Locked scenario    coderanch.com

I am not sure whether i am posting this in the correct forum. We are using SLSB(CMT) and Hibernate in our application. One of our SLSB interacts with the database for database operations. We are trying to find a way through which we can show the user a message whenever the Database is locked(may be for backup). Here's our scenario: - ...

20. JDBC Application against multiple databases    coderanch.com

I am looking to write the Java application which should be able to run against multiple database namely Oracle, Sql Server and DB2, however only one at any given time. Properties file will be used to configure the database driver and connection params etc. I am looking for Tips, Pitfalls and any help to avoid the problems rather than discovering them ...

22. Optimizing a database    coderanch.com

Hi fellas, I have been having trouble finding quality information on the topic at hand, and I hope this thread will help everyone who reads and responds to it. I have a database which contains a fairly large set of financial data and initially I structured the database with organization principles in mind. However, I am slowly realizing that the current ...

23. embedded databases    coderanch.com

first you should look what an embedded database means, it means that database will run on the same JVM that you application run. so , it will use shared resources.... usually we use embedded database for cases like : 1-providing application that works standalone with no need to setup another databas 2-we do not need full featured database server , features ...

24. Database Initializatio    coderanch.com

Hello Ranchers!! I need your help in configuring the database in the Sun's Application server 8.0 PE .. i'm using the Admin Console for connecting the database!! In that i logged on to the Resources -> JDBC -> Connection Pools from there i clicked the new button.. and give the following values Name : test Resource type : javax.sql.DataSource Database vendor ...

25. Access Database    coderanch.com

Hello Pree Sree!! there are some drawbacks for the MS Access Database!! u can select using the execute(query) but when u try to insert use the Prepared Statement!! ok we can insert.. delete using PreparedStatement!! select work in execute() i'm not sure abt the update table statement.. in msaccess.. i tried it long back!! but when i tried it in oracle.. ...

26. database->feeds->database    coderanch.com

Hey guys, I have a question here. How could you possibly get feeds out of one database and input to other database. Why would you do that typically, I mean do anybody do this kind of things anywhere. Confusing right. I know. Okay let me keep it this way. If you have a front end application which feeds data to a ...

27. Very Beginner Database Question    coderanch.com

I am very very new to Java programming so please keep your answers simple. I have never used a database with Java in the past and I am trying to create a program that needs one. This question is probably won't be a short answer so I think I am looking for a link to somewhere I can learn this. I ...

28. database access    coderanch.com

29. java + 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. - ...

30. Packaging Database Applications    coderanch.com

Not strictly a technical question but I hope this is the most appropriate forum. I'm writing an application that will work with a number of database platforms by limiting myself to simple tables and indexes. I am just a little concerned about the level of complexity required to install the database schema and also the steps required to update the users ...

31. how database handle request?    coderanch.com

Hi friend, I want to write a program that can access to multiple database based on the user ID, but I dont know how the database handle user request. Please help me... if user A execute program and redirect to database abc, and user B also accessing it. user A retrieve value from database but not yet update it, at the ...

32. Back Up & Restore Database    coderanch.com

Why do you want to do this? Is this a school project? Because there lots of tools already for this type of thing. The best way to backup and restore a MySQL database would be the following. 1) Make your program that can run SQL script files (files full of SQL statements). To backup 2) Dump the table definitions (as CREATE ...

35. url for access db?    coderanch.com

37. Enterprise DB    coderanch.com

38. ENTERPRISE DB    coderanch.com

39. ByteArray converted to a String to store in database    coderanch.com

Most databases have a datatype specifically designed for Binary Large OBjects; this datatype is called "BLOB" and is what most people use to store image data in a database. Most databases have internal limits on the size of character strings supported by the normal string datatypes, but many have an unlimited size string datatype, called CLOB (character large object). For your ...

40. First Bean with Database    coderanch.com

package num; public class TestBean { protected String lastName; public TestBean() { } public String getLastName() { viewBeanDb(); return lastName; } public void setLastName(String aLastName) { lastName = aLastName; } public void viewBeanDb() { getData(mydata); } } public void getData(String mydata) { Class.forName("org.gjt.mm.mysql.Driver"); conn = DriverManager.getConnection("jdbc:mysql://localhost/myfirst?user=root&password=aaaaaa"); Statement stmt = conn.createStatement(); ResultSet results = stmt.executeQuery("SELECT * from user where lastname = 'Jones'"); ...

41. Free DB    coderanch.com

MySQL (using the InnoDB engine) is currently used in many commercial products. As long as you are not selling a product containing the DB, but rather are only providing a service (i.e. a website) that uses the DB, then it is free. If, however, you distribute anything that relys on the DB, (i.e. selling your program and it needs MySQL), then ...

42. Choice of database    coderanch.com

Money. MySQL is free to use for most small projects whereas Oracle, MS SqlServer, and DB2 have pretty big bills associated with them. As far as choosing between the 3 its then a matter of whether or not you have the technical resources available. Oracle is probably the best and most powerful but if you don't have a dedicated Oracle expert ...

43. Help Regarding using Access Database in java    coderanch.com

Hi, I am using Access as the database for my project. I am displaying the user information stored in the database as per the user request. I want to display only first 5 records and after clicking next button next 5 records like that. I dont know how to control and display the records from the database. can anyone tell me ...

44. How to change user credentials when accessing DB    coderanch.com

Hello, The project that I am working on, one thing we are looking at is the ability to use the same user credentials (username, password) on both the application side and the DB side. This would mean that when someone logs in using a specific username/password, we would turn around and use those credentials when connecting to the RDBMS. If we ...

45. access to database    coderanch.com

No. Well, ok, I suppose if the database was on your local pc and you wrote a program that could read the files that the database engine uses to store all the data...well, then yes. But someone already did this. The db vendor. ;) [ July 27, 2006: Message edited by: Gregg Bolinger ]

46. how to use special characters in database name    coderanch.com

Hi, I am using osql (transact sql) for creating a new database in MSDE (Microsoft SQL Server Desktop Engine). I want to use special characters in the database name: like: MyDb.2003.7 But whenever I use '.' character in database name, it gives an error. How should I go about creating a database with special charcters in it? Thanks Nidhi

47. changing database    coderanch.com

i have an doubt that iam using JBoss AS, my scienraio is inital when start my Application Server it will connects to mysql DB datasource, i will retrieve some values those are DB Names like oracle,sql server,db2 etc in my JSP page iam placed at combo box upto this i am very much successful but now my problem is after gettinh ...

48. Compact and Repair Access Database    coderanch.com

Do you need to run that utility to "compact" or to "repair"? Either would scare me - make sure you're backing up the DB frequently. It may be a sign that the DB is outgrowing the limits of Access (which wasn't meant to hold large amounts of data). I don't think there's a direct way, but you may be able to ...

50. database doesn't fill List    coderanch.com

51. how to use database    coderanch.com

52. How to check whether DB is alive    coderanch.com

Hi Guys, Please clarify this to me. I have to connect to a DB2 DataBase. I am creating connection object first and using that object to do various transactions. I am creating connection in the constructor of my class. My problem is, When my database crashes and immediately recovers to normal state.(I will not know whether DB is crashed). Then I ...

53. how to extract database metadata    coderanch.com

Hi thank you for reading my post is there any way that i can extract a database metadata into a .sql file or a posibility to extract the metadata and forward it to another database? is there any library that make this job easier to do ? it looks that directly using conn.getMetaData(); will be the hard way. thanks

54. Database Access    coderanch.com

55. Unable to match database value with string    coderanch.com

I'm trying to redirect my user based on the value in the database but somehow my code doesnt seem to work. Even if the value of Status is "Pending" in the database it goes to response.sendRedirect("deletestudentlist.jsp"); instead of response.sendRedirect("viewstudentlist.jsp"); The problem i presume is in (status1 == "Pending") but not sure what is wrong. Please do help. Thank you. rst1 = ...

56. Can not be get and set values from the database    coderanch.com

Guys, I need to assign the value which got from database and show it as a text field of may frame created, But the thing is both of valuse are different (Strings and Textfield) So, can not be assigned Help me out, try { // Create a result set containing all data from my_table Statement stmt = conn1.createStatement(); ResultSet rs = ...

57. general db question    coderanch.com

hi all I did 'explained analyze'ed in postgresql. But I couldn't understand the output. Which is the outer relation and which is the inner relation? Is two the outer relation? If so, does it that the optimizer didn't choose the smaller table as the inner relation(i believe using the smaller table as the inner speeds up the join, at least for ...

58. Multiple databases    coderanch.com

Greetings Fellas, I'm in need of a new architecture for the web server that I host. I'm currently running my application on the standard Tomcat Servlet container and use MySQL as my database. I'd like to create two separate databases that are structured quite different to efficiently handle two separate requests. However, I'd like to access both of these databases on ...

60. Database refresh    coderanch.com

Sometimes we need our development servers to be refreshed with data from our production servers. We raise a request to a DB group and they take care of it for us. I was wondering if there exists a tool that would allow us to make a quick copy of data from some limited important tables (these tables would be identified by ...

61. How to keep database safe from multiple operations?    coderanch.com

Hey guys! Here is the problem: I have implemented a website for internal use. The users may edit the same line in database concurrently, which may cause collision. However, I can set a lock on the particular line before edit operation. Do you think this is the only solution? In some extream case, what can I do if the users require ...

62. database accessing time    coderanch.com

Define "too much time". With only 400 rows, if it is slow, it is more likely the overhead of creating a connection rather than the data transfer time. Make sure you enable connection pooling. After that, check if your JDBC drivers are up to date, and the servers/network configuration. [ January 30, 2007: Message edited by: Chu Tan ]

63. General question - do major media sites use databases?    coderanch.com

(Bartender: Hope this is the appropriate forum, I was trying to avoid cross posting in multiple.) I was wondering how major media web sites such as a newspaper or sports news site manage the process of storing and serving up their articles? Are they stored in a database with web technology to build the pages for each user? Or is there ...

64. Newbie database question    coderanch.com

Hi, This is my first post to this forum, and its very much a newbie question ... I have been in the software industry for a while, but I'm fairly new to the java world. I have some knowledge in the area of SQL and to a lesser degree JDBC. In my leisure time, I'm part of a very small non-profit/hobby ...

65. Hypersonic DB question    coderanch.com

A constraint is a validation mechanism. It will guard that the data that you write adheres to your rules. Your constraint CONSTRAINT SYS_STOREACCESS_UQ UNIQUE(USERNAME) will allow only unique values in column USERNAME. If your table STOREACCESS has a record with USERNAME == 'Joseph Sweet', and you try to insert a new record with USERNAME == 'Joseph Sweet', it will fail. Also ...

66. Database Starnge behaviour    coderanch.com

Dear ALL, i'm trying to access some data from my database but i have A strange behavior and hope to help me to understand what is happening when i try to retrieve column data form DB and print it it will be printed but when i try to assign it to a String i get this exception "NO Data Found" Query=" ...

67. Stand-alone Databases    coderanch.com

I have a very simple question to ask all of you. At the moment, I am developing a small journal like application and I want to store all of the information in a database. I want to create a blank database and package it with the final application. I have run into the problem that most databases run on a server ...

68. Passing application info to database    coderanch.com

Hi, In most of the application we've some auditing information like created by, creation date, etc to be stored in database along with transaction information. This can be done via triggers or explicitly passing this information in SQL constructs through JDBC calls. I recently read about getClientInfo and setClientInfo methods available on connection object in JDBC 4.0 specification. Can we use ...

69. how can i store picture in my database    coderanch.com

70. database errror    coderanch.com

71. JDBC QueryTimeout and Databases    coderanch.com

73. Draining database resources or not?    coderanch.com

It turns out I had two areas I was not closing my Database connections. I closed them and now everything is okay with no JDBC Thin Client programs showing up. Do I need a Connection Pool for a Database that is only hit on at most 10 times a day and hardly ever has Concurrent users hitting on it?

74. retriving bit from Database    coderanch.com

hi guys i am unable to get the data from the column of a table the data type of that column is bit .but iam able to get remaining column values properly iam getting an acii character for the records of that column value having 1 and nothing printed for the records of that column is 0 tha data base iam ...

75. retriving bit from Database    coderanch.com

hi guys i am unable to get the data from the column of a table the data type of that column is bit .but iam able to get remaining column values properly iam getting an acii character for the records of that column value having 1 and nothing printed for the records of that column is 0 tha data base iam ...

76. Which database should be used?    coderanch.com

Side note- I suggested MySQL because if you're getting started in JDBC for the first time and need a learning tool, you're probably *not* making the decision to release products for a commercial company PS And even if you are, then if you are a beginning you should *definitely* use MySQL in this case so you don't waste tons of money ...

77. Database structure    coderanch.com

Add another table with two (or more) columns, where the first column is a key back to your original data and the second column is a value. Usually when the words "arbitrary (large) size" come up, its an indication your structure should be grouped to support a fixed number of columns with an arbitrary number of rows. Generally in the database ...

78. TAlly and my Database    coderanch.com

79. turn on / off db constraints -    coderanch.com

(java / mySql) Im trying to run some batch commands one after the other - Yet since part of them may fail due to constraints failures I want to turn off the DB constraints, and turn it back on just after the last batch is executed (in the same connection!!!). Once the constraints are back I want to see ...

80. DB structure    coderanch.com

Hi guys, I have quite a trivial query. I need to store a count of a particular entity, for example number of purchases. Hence everytime a customer buys something the purchases count increases for the user. In my database, should I have a column which keeps track of all 'purchases' or should I just go to the purchase table and perfrom ...

81. Embedded java databases.    coderanch.com

82. Reconnecting to Database    coderanch.com

I have an application that is constantly running 24/7. In the event of a network outage, this application has to be restarted, as when a user tries to use it, it will tell them the connection does not exist. I am not using connection pooling. Is there a way that I can find out if the connection still exists, and if ...

83. What is JDBC Database?    coderanch.com

That term is a bit odd. JDBC is the Java API for accessing databases. But it's not the database that implements JDBC, it's the database driver (which is a Java library). So what may be meant by that term is a database for which a JDBC driver exists, and which thus can be accessed by Java code using JDBC. Just about ...

84. database design document    coderanch.com

Every document should contain exactly what the reader needs to know. That sounds like a smart-ass answer, but seriously, why else would you write one? So, you first need to meet your readers and find out what they need. Are they newbies who need everything spelled out? Experts who know more than you and I ever will and just need broad ...

85. Database program major issues.    coderanch.com

First below is the code. import java.sql.*; public class Lab2_1 { static String driver = "COM.cloudscape.core.JDBCDriver"; static String url = "jdbc:cloudscape:SimpleDB;create=true"; 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()); } } } I need to take the CIW database Certification. I ordered there ...

86. DB Vs Mq    coderanch.com

We need to process the messages from upstream application. We will be able to process the message only if we have got all the data for a particular business, so till then we may need to store it in a place. The messages needs to be sorted out based on a entity before it gets processed. Here is what we need ...

87. how to avoid special character in database?    coderanch.com

Really the question is not how to avoid entering special characters in a database... it is how to avoid upserting characters that are not supported by the database's configuration. It isn't just special characters, carriage returns, etc. If the character is not supported by your database's configuration, it becomes unprintable, unreadable, and most of all... it makes that column virtually useless ...

88. import database    coderanch.com

hi, i have an project done using mysql database and i want to run in my machine how to configure that data base to run in my machine, my project done using tomcat. i copy the project to webapps folder and now have to configure the database how to do that please help thnks in advance

89. display open database objects    coderanch.com

90. Closing DB issue in new method    coderanch.com

public class MainClass { public PreparedStatement preparer; public Connection connection; public MainClass() { connection = new DbConnectionClass().getConnection(); } public int inserter(Beann abc) { int dat = 0; try { preparer = connection.prepareStatement("insert into abTable (one,two) values (?,?)"); preparer.setString(1, abc.getOne()); preparer.setString(2, abc.getTwo()); preparer.executeUpdate(); } catch(Exception e) { e.printStackTrace(); } return dat; } public int matcher(Beann abc) { try { inserter(abc); } catch(Exception ...

91. HF-SQL - Is DB Centric?    coderanch.com

92. how long execution plan for PreparedStatment live on Database    coderanch.com

How long execution plan for a Prepared statement remains valid at database. let say i create a prepared statement for an update statment and my code excute that statement 500 times so i understand that during first call the excution plan or some other setup done for executing prep statement will be created at database side and will be valid for ...

93. HF-SQL - Database types    coderanch.com

94. Store array in database    coderanch.com

95. Database helper class and closing question    coderanch.com

I have a JDBC working with Oracle 9i where database is inserted/updated maybe 10 times at most during a week with very little usage in my Tomcat 4.1.3 Container. The Database classes I have used for the past year are working great but I wonder if I should be closing anything in my database helper class with Prepared statements: public class ...

96. Whacky db problem.    coderanch.com

This is Oracle 10i. The code I am running is not my code but an example from the class material (I am taking Advanced Java). When I looked at the prepared statement (SELECT) I thought the same thing about the single quotes missing but why when I run the code to query for the 1st record in the table, I get ...

97. Database best practice    coderanch.com

I have been trying to research best programing practices in relation to database queries and I have read a few websties which give the advice that you should always close Statements, PreparedStatements, ResultSet, etc before closing the connection and in doing so not to wait until the garbage collector decides to clean up these objects. What facts are there to suggest ...

98. upgrade to database causes memory fault when running app    coderanch.com

We were using COM.ibm.db2.jdbc.app.DB2Driver (a type-2 driver). It was working fine with this driver until an upgrade to the database (to DB2 v8). But now it's causing a memory fault when using the original driver. So we switched to com.ibm.db2.jcc.DB2Driver (using as a type-2 driver) which does not cause the memory fault. The app copies from a table in one database ...

99. Calling Java API from database stored proc    coderanch.com

Hi All, Please excuse me if i am posting my concern at wrong place. Actually I need to call a Java API from database stored procedure. I am using Oracle 10g database. I have a jar for the classes. I need to call the methods from these classes. I have never done it earlier. Can anybody suggest me, what is the ...

100. Clean database    coderanch.com

Hey, is there a way (i dont mind to use tool) to clean the DB. Dont delete the tables, only delete the content. if i do it one by one i failed with constraints error. can i some how get the order or have a workaround or tool that will do it for me? Thank you