Member Avatar

Hi and Greetings, I am new to these forums, so if I submitted this to the wrong forum, my apologies. Before I get to my question, a little backstory. I was running an application on my laptop that was using Microsoft Vista, with Microsoft Office 32 bit and JRE 1.5. I could connect to the MS Access database with no problems, I dont think I even had to specify the data source (I wish I could elaborate further, but the code works on that computer, so I didn't ask questions or dig into it farther). That was about 4 years …

Member Avatar
+0 forum 4
Member Avatar

I want to create a Entity class with database in Netbeans. When i select a Data source jdbc/Ionbank (custom Jdbc connection Using JDBC-ODBC bridge with Ms SQL 2005 as database). I see all the table from that database. All tables show no primary key, but they have primary keys in them. I am trying to find out what is problem. Thing i tried :- 1. Created new 4-5 data source. 2. Created tables using query, and not the New table option. 3. Tried changing Odbc connection. 4. Tried using different drivers for the Jdbc-Odbc bridge like Sql4jdbc.jar, Jdts.jar. Still No …

Member Avatar
+0 forum 1
Member Avatar

I am getting java.lang.nullpointer exception for this code plzz help me out all database linked programs are creating same error [code]import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; public class retser extends HttpServlet { Connection c; Statement st; ResultSet rs; ServletConfig config; public void init() { config = getServletConfig(); try { Class.forName("oracle.jdbc.driver.OracleDriver"); c = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "tiger"); Statement st = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); rs = st.executeQuery("select * from book"); } catch (Exception e) { } }//end init public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter pw = res.getWriter(); try { int x = Integer.parseInt(req.getParameter("t1")); pw.println(x); rs.next(); pw.println(rs.getInt(1)); //+" …

Member Avatar
+0 forum 1
Member Avatar

I am in need of creating a payroll system, I have created setters and getters for classes such as Persons, and COntactInformations, I am wondering how would I put each objects value or the value of it's attributes?

Member Avatar
+0 forum 1
Member Avatar

I'm create a program using java and MySql (jdbc) my problem where I'm start up the program in my customer computer , i must set up MySql program or not

Member Avatar
+0 forum 3
Member Avatar

I have installed MySql here already, now i need to connec it because I am going to make a project which it needs a Database, but my problem is that I don't know how to set the connector/j/ I don't know how to install it/I don't know how to put it in my classpath. help please?

Member Avatar
+0 forum 1
Member Avatar

Hi guys, hope you can help. I'm creating a mixture of an employee scheduling system with elements of a Human Resource Management System for small to medium businesses. I ideally want to create a java application with a database backend, which I'm trying to see if I can apply sql server. I recently got sql server working in my java EE tutorial, but thats an applet and not an application. I'm almost finished with my research, just finishing off some questionaires. But I really need to finish my decide on which languages I'm going to use. Can I get peoples …

Member Avatar
+0 forum 2
Member Avatar

Hi, I have this requirement that I have been trying to solve for a couple of days now. I have this source DB. The objective is to extract data from this source DB and insert into a oracle table. The meta data for both tables are the same (1-1 mapping). Essentially I am trying to do a "insert into <tablename_1> select * from <tablename_2>" through a JDBC connection. Any ideas? Drjay

Member Avatar
+0 forum 1
Member Avatar

Hello all! I'm helping my employer redesign their database system. They're currently using MS Access exclusively, but they are updating their computer systems to Apple machines and want to convert to a standalone application to access a background database (e.g., a standalone Java program using JDBC to access a background Oracle DB). My questions are: [LIST=1] [*]What would you recommend for the background database program, assuming the system will be running on OS X and the standalone program will be written in Java? [*]Do you have any comments or advice regarding this setup? Do you have a better suggestion? [/LIST] …

Member Avatar
+0 forum 1
Member Avatar

hello friends i am new to ejb and i tried to create a session bean for obtaining JDBC Connection,and i called it from a servlet the session bean was a remote session bean but connection is not getting established.. EJB CODE : ConnectionBean.java [CODE] package com.ejb; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import javax.ejb.Stateless; import com.mysql.jdbc.*; /** * Session Bean implementation class GetConnect */ @Stateless public class GetConnect implements GetConnectRemote,GetConnectLocal { /** * Default constructor. */ public GetConnect() { // TODO Auto-generated constructor stub } public Connection getConnect() throws ClassNotFoundException { Connection con=null; try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/jobportal","root","root"); System.out.println("Connection is:"+con); } …

+0 forum 0
Member Avatar

I don't know am i asking right question or not but my question is: I want to create a simple search site so I've team with different jobs. I have its database part to handle. I should create its database and i have not idea what should i do. I'm a newbie java programmer so i was thinking of may be JDBC + mysql would help if i read them. Is it good idea or its bad? Can someone please say me what should i be doing now. or does it depends upon what programming language is site based on..

Member Avatar
+0 forum 1
Member Avatar

I don't know am i asking right question or not but my question is: I want to create a simple search site so I've team with different jobs. I have its database part to handle. I should create its database and i have not idea what should i do. I'm a newbie java programmer so i was thinking of may be JDBC + mysql would help if i read them. Is it good idea or its bad? Can someone please say me what should i be doing now. or does it depends upon what programming language is site based on..

Member Avatar
+0 forum 2
Member Avatar

Can any one tell me I learnt about JDBC,Hibernate technologies. I wonder about WEB Projects which uses JDBC technology exist today.? If yes How they are configuring JDBC Logic in web application in practical scenario. thanks.

Member Avatar
+0 forum 3
Member Avatar

Heya guys, I am trying to make a desktop application for my assignment. I have to design an application that will have a JTable, JTextField and Buttons. I am done the GUI part. The input that user enters into the table should get stored into the database using an "insert" button(using JDBC). I know how to connect to the database and how to insert stuff into it. But I do not understand how can i edit my table and after the table is edited. The database should update. Also, how can i send string objects(input from the JTextField) into the …

Member Avatar
+0 forum 1
Member Avatar

Hi everyone, I had designed an application with Java as front end and mysql as back end. The client application uses both local database as well as Remote mysql server's database for login and other retrievals. I don't know how to generalize the database connectivity code?, I need to access a remote database for more than couple of times,for each time I am creating a new connection(copy paste the same code) and just changing the query, my program size increases and retrievals take more time(>1min). [CODE] Connection connect1 = null; Statement statement1 = null; ResultSet rs1 = null; float available_qty; …

Member Avatar
+0 forum 5
Member Avatar

i am working on a project in which, i have a text area and when the user enters some details in that text area, the data should be saved in a text file and the path should be saved in the database, when another user wants to access that text file, he could retrieve that using that path. I am using SQL SERVER management studio express 2008. How can i do this?????? Please please help.........

Member Avatar
+0 forum 3
Member Avatar

Hi all, I'm stumped and can't seem to find an answer on Google. I am running a java application through Eclipse and it connects to mysql. It connects fine if I run it through Eclipse but if I make a standalone jar file and then run it through Window's Vista command line then i get this error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at database.Connect.ConnectDB(Connect.java:16) I have downloaded mysql-connector-java-5.1.16-bin.jar file and placed it in the classpath and path environment variables. …

Member Avatar
+0 forum 2
Member Avatar

Hi all, I'm currently trying to solve a problem with a JList. I've got an actionPerformed event applied to the JList (also tried the item updated event but it has the same effect), and whenever this event is fired, (i.e. the user makes a selection), something happens. Now, the problem is that when the list is being populated, it seems to fire the event too - thus creating problems for me. Is there a way to stop the JList from firing the actionPerformed or itemStateChanged event when the contents is updated? Thanks P.S. Question has also been asked here: [url]http://www.java-forums.org/awt-swing/41914-how-stop-jlist-firing-events-when-contents-updated.html#post195009[/url]

Member Avatar
+0 forum 7
Member Avatar

i am designing a small client server system for a hospital, in this system a receptionist will forward the details of patients as they come to the particular doctor, like i go with a problem related to skin disease, my case would be transferred to that particular doc, I am using jsp for this. PROBLEM:- somebody suggested me that you can't a client server system on a LAN using TYPE 1 DATABASE IN JDBC-ODBC BRIDGE, i am really confused as i have never used type 4 db. Can't my system work with type 1 database?????? HELP ME, PLEASE PLEASE PLEASE …

Member Avatar
+0 forum 2
Member Avatar

Hi, I have to insert data into a database table using jsp and jdbc, query the table data and convert it into an xml file. I am using NetBeans IDE. I'm really stuck and i have a project due. Please do help:'(. Thanks in advance.

Member Avatar
+0 forum 3
Member Avatar

Hye I have a question: Suppose I use JDBC, JDBCTemplate in order to execute a sql query. The query is something like: query = "SELECT ... FROM ... WHERE user = ? AND password = ? AND x='valuex' AND y='valuey' ..." Where user,password - I got from the web user - so I want it to be in a PreparedStatement. But x,y,... (Suppose there are many variables like this) are values which I set their values myself at the code (e.g. constants), so there is no use for PreparedStatement on them. Is there a way I can combine the two …

Member Avatar
+0 forum 6
Member Avatar

am trying to connect a jsp page to a postgress database i have created a jdbcconnects.java file and compiled it with jsp_api.jar from my apache..../lib directory i have placed the class file in root/WEB-INF/classes folder the code of my class file is [CODE] import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Jdbcconnections { public Connection connect()throws Exception { Connection con = null; try { Class.forName ("org.postgresql.Driver"); con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/EMPPWD", "postgres", "ankur"); } catch(Exception e) { System.err.println("Exception: " + e.getMessage());} return con; } } [/CODE] in the jsp page i have written [CODE] <%@ page import="Jdbcconnections" %> Jdbcconnections obj=new Jdbcconnections(); Connection …

Member Avatar
+0 forum 1
Member Avatar

I have two problems 1) I want to display the customer details like account number, name, dob, etc. in a different customer account frame (written in another class) and hence I want that the same username that I logged in with, to use in the select query( i.e. select * from [tablename] where [the sameusername I logged in with] ) in the customer account page. How can I do that? 2) When checking for validity of username and password it works fine when I type in a username that exists in the database. But for any other username it does …

Member Avatar
-1 forum 2
Member Avatar

i am having some connectivvity issues i am using postgres 9.0 sql db i have installed a dns localhost using the postgres sql driver also i have the jdbc jar files in the lib dir of the tomcat my code is [CODE] <%@ page language="java" import="java.sql.*" %> <% Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sample", "postgres", "ankur"); Statement stmt = conn.createStatement(); String StrUser = request.getParameter("username"); String Age = request.getParameter("age"); stmt.executeUpdate("INSERT INTO tab1 VALUES ('ankur',21);" ); stmt.close(); conn.close(); %>[/CODE] the error generated is avax.servlet.ServletException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "[" Position: 18

Member Avatar
+0 forum 8
Member Avatar

I want to store data that user inputs [form based in form of xml] into a postgres database, so I would like to know is it wise to develop a web service or how do I transfer data. I am completely clueless how to head on with the problem

+0 forum 0
Member Avatar

Hi All, In my development of an online application, I have to generage the serial no for the available number from the serial number table in sql server. Multiple users will hit the table to generate the serial numbers. So the serial number should not be repeated. I have to lock the row as a user reads the table and release it only when the transaction commits or rollbacks. I am doing this as follows with no success. Please help me in the correct way. get the connection Set the auto commit of the connection as false. query the serial …

+0 forum 0
Member Avatar

Hi, I'm beginning JDBC and I'm conversant in SQL. But I need to Connect to database and that where the problem lies. All I have done is adding mysql/j connector Jar to Netbeans project and wrote code below to test. It cannot connect to database. Also IDE throws error: [CODE=JAVA] package dbclass; //imports import java.sql.*; public class DBClass { public ResultSet changeDBInfo() throws SQLException { Connection conn = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection(this.host, this.userName, this.passWord); if (!conn.isClosed()) { System.out.println("Connected Successfully"); } Statement st = conn.createStatement(); return st; } catch (SQLException e) { e.printStackTrace(); } finally { conn.close(); } …

Member Avatar
+0 forum 34
Member Avatar

Hi.. I am trying to connect to my database (MySQL) within a JSP page. The is compiling without any error, but still I am not getting any output. Can anybody help?? The code is as follows: [CODE] <%@page contentType="text/html" pageEncoding="windows-1252"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head><title>Enter to database</title></head> <body> <table> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="java.sql.*" %> <% java.sql.Connection connecton=null; java.sql.Statement stmt=null; java.sql.PreparedStatement prepStmt=null; ResultSet rs = null; try { Class.forName("com.mysql.jdbc.Driver"); connecton=DriverManager.getConnection("jdbc:mysql://localhost:3306/project_demo","Sops","adminadmin"); stmt=connecton.createStatement(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } String sql = "select * …

Member Avatar
+0 forum 4
Member Avatar

I posted this on Oracle Forums to the sound of crickets chirping. This question entails more Oracle specific tasks then java but since my code is in java, here goes" Hello, I have a java package where I am attempting to implement a database Change notification registration and listener. I can create a registration but my listener fails to notify the operating thread when a change occurs on the registered table. For my example, I can successfully register a change notification on a table named "<user>.CUSTOM_TESTER". When I call getTables() from my registration object, it returns: "<user>.CUSTOM" omitting the rest …

+0 forum 0

The End.