I recall reading about XML support from MySql. Does anyone know how to get XML without writing code? My client-protocol expects XML and I have a data source that I can access from a web app (JSP using JDBC).
...
I'm getting the following exception when executing the first preparedstatement after a period of inactivity:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 2,855,054 milliseconds ago. The last packet sent successfully to the server was 123 ...
Looking at some old application code which uses explicit driver loading as
Class.forName(...).newInstance
I have been told to change this to use the Java 1.4.2 mechanism to establish a database connection using ContextLookup, and DataSource.
Are there any gotchas I should be aware of?
...
Hello,
Is it possible to set the Oracle connection cache to restart cached connections after a period of time?
...
How display ResultSet in JTable. i using this code
/*String [] record= new
String[ColCount];
for (i=0; i<ColCount; i++)
{
record[i]=rset1.getString(i+1);
}
cell[i] = rset1.getString("loginname");
cell[i] = rset1.getString( "role");
System.out.println(cell[i][0]);
//ItemGroup = rset1.getString( "Status");
}
System.out.println(...
it's possible to alias all column with a prefix, in a select?
I have a group of tables in an Oracle db that I need to join together, and most of them have the same column names. I would like to have something like
select MAGIC_ADD_PREFIX("PREFIX", *) from TABLE
and have a result like
+---------+----------+----------+
|PREFIX_ID|PREFI...
I have some Java code that connects to an Oracle database using DriverManager.getConnection(). It works just fine on my Windows XP machine. However, when running the same code on a Solaris machine, I get the following exception. Both machines can reach the database machine on the network. I have included the Oracle trace logs.
Mar 2...
I inherited some code that is using the Apache commons-dbcp Connection pools in an OSGi bundle. This code works fine with Eclipse/Equinox OSGi version 3.4.3 (R34x_v20081215), commons-dbcp 1.2.2 and the postgres jdbc3 8.3.603 bundles from springsource.org.
I wanted to modernize, maybe this was my first mistake!
When I use the new versio...
I am doing profiling of my Java application and found some interesting statistics for a jdbc PreparedStatement call:
Given below is the environment details:
Database: Sybase SQL Anywhere 10.0.1
Driver: com.sybase.jdbc3.jdbc.SybDriver
connection pool: c3p0
JRE: 1.6.0_05
The code in question is given below:
try {
ps = conn.prepareSt...
I'm looking for feedback on the Data Access Object design pattern and using it when you have to access data across multiple tables. It seems like that pattern, which has a DAO for each table along with a Data Transfer Object (DTO) that represents a single row, isn't too useful for when dealing with data from multiple tables. I was thinki...
Is there an equivalent of (ADO.NET) DB.Null in JDBC? Or do I simply pass null in the parameter?
Particularly in the context of Mysql?
...
Is there a default classpath on Mac OS X 10.6? When I echo $CLASSPATH, nothing would show up. In my .profile, I only see PATH variable being set. My problem is that My servlet cant seem to find a suitable driver to connect to the mysql server. I use Eclipse, with Glassfish v3 and MAMP for MYSQL server.
...
i am writing stored procedures in MySQL that return values;
CREATE PROCEDURE getCustomerById (id int)
BEGIN
SELECT *
FROM customer
WHERE customer.id = id;
END;
and i get the error that the results cannot be shown in the given context.
after some googling, i think that i need to set the flag "CLIENT_MULTI_RESULTS" - i am conne...
I have the following environment set up:
Java 1.5
Sun Application Server 8.2
Oracle 10 XE
Struts 2
Hibernate
I'm interested to know how I can write code for a Java client (i.e. outside of a web application) that can reference the JNDI datasource provided by the application server.
The ports for the Sun Application Server are all at ...
I'm using the NetBeans IDE(6.8). I have a DB class :
package garits;
import java.io.Serializable;
import java.sql.*;
import java.util.Properties;
public class DB implements Serializable{
private static final long serialVersionUID = 1L;
String dbURL = "jdbc:mysql:///team_project";
String user = "root";
String pwd = "arsenal";
...
hello friends i am using oracle as backhand and jsp servlet as frunthand i am executing update query and i want to identify wather update query has made updation in database or not. i am using executeUpdate() it is executing but it results 0 when update query fail to execute and 1 when execution is done but it does not identify wather da...
I'm getting the following error when I try to run a simple Java JDBC program at the command line:
Exception in thread "main" java.lang.NoClassDefFoundError: LoadDriver/java
Caused by: java.lang.ClassNotFoundException: LoadDriver.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged...
Hello,
In the database, I have a definition table that is read from the application once upon starting. This definition table rarely changes, so it makes sense to read it once and restart the application every time it changes.
However, after the table is read (put into a ResultSet), it will be read by multiple handlers running in their...
I am facing severe problem with JDBC ,converting string to integer.
String query = "Select F2, F3, F4 from myTable ORDER BY {fn CONVERT(INT,F4)}" ;
error: Syntax error in ORDER By clause;
...
I am developing swing based application with hibernate in java . And ı want to make search on database , and listing result...
Before ı used to JDBC and ResultSetTableModel , and my before code is here :
try{
Class.forName("*****************").newInstance();
Connection baglan=(Connection) DriverManager.getConnection("*******...