Android app submit button not working on sending gps data to mysql server

I’m trying to create a simple app that submits GPS data to a website MySql server but when I added the code for getting the GPS location the submit button stopped working Any help would be greatly appreciated public class MainActivity extends AppCompatActivity { EditText inputName; String currentTimeDate; TextView timeView, latView, lonView; double longitude, latitude; … Continue reading “Android app submit button not working on sending gps data to mysql server”

i have a sql select query error dont know what the right syntax is

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String sql=”select * from account where Username and Password=(?,?)”; //I think here is some error but dont know what it is try { stm=con.prepareStatement(sql); stm.setString(1,jTextField1.getText()); stm.setString(2,jPasswordField1.getText()); rs=stm.executeQuery(); if(rs.next()) { rs.close(); stm.close(); setVisible(false); Loading ob =new Loading(); ob.setVisible(true); } else { JOptionPane.showMessageDialog(null,”Incorrect username and password”); } } catch(SQLException exp) { JOptionPane.showMessageDialog(null, … Continue reading “i have a sql select query error dont know what the right syntax is”

RemoteSolrException: ERROR: [doc=2] unknown field 'firstName'

I wrote a Spring project that uses SolrInputDocument to add data from tables. I have used doc.addField() method doc.addField(“actorId”,a.getId()); doc.addField(“firstName”,a.getFirstName()); (posting only few of them) for adding data that I have retrieved from MySql. When I am trying to add these values to SOLR index, I am getting the following error. Exception in thread “main” … Continue reading “RemoteSolrException: ERROR: [doc=2] unknown field 'firstName'”

No tables created in the MySQL database in Spring Boot application

Here is my Application.java: @Configuration @EnableAutoConfiguration(exclude = {JpaRepositoriesAutoConfiguration.class}) @ComponentScan @SpringBootApplication public class UserFrontApplication { public static void main(String[] args) { SpringApplication.run(UserFrontApplication.class, args); } } Contents of application.properties: spring.datasource.driverClassName=org.gjt.mm.mysql.Driver spring.datasource.url=jdbc:mysql://localhost:3306/mydb spring.datasource.username=root spring.datasource.password=password spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=create pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd”> 4.0.0 <groupId>com.userFront</groupId> <artifactId>userfront</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>UserFront</name> <description>User frontend for online banking</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.3.RELEASE</version> <relativePath/> <!– lookup parent … Continue reading “No tables created in the MySQL database in Spring Boot application”

Hibernate DELETE query Error Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'gestcart.loanpersonrelation' doesn't exist

I have a problem whit Hibernate querys, i exccute a process to delete one row in te DDBB hibernate launch the follow error: Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:80) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) at org.hibernate.loader.Loader.doQuery(Loader.java:910) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) at org.hibernate.loader.Loader.doList(Loader.java:2554) at org.hibernate.loader.Loader.doList(Loader.java:2540) at … Continue reading “Hibernate DELETE query Error Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'gestcart.loanpersonrelation' doesn't exist”

How to Delete and Modify Datas using Struts2 and Hibernate

I created a jsp page that shows me the list of doctors (medecin in french) contained in my mysql database via the hibernate framework and struts2 . I have a delete button supprimer (in french), to remove a doctor, and a button , modifier , to edit the doctor’s data . The edit button , … Continue reading “How to Delete and Modify Datas using Struts2 and Hibernate”

Oracle's ROWID / ROWNUM in MySQL

I’m trying to get the equivalent for this code on MySQL try(Connection c = DriverManager.getConnection(“jdbc:oracle:thin:@myhost:1521:”+ vardbserver, vardbuser, vardbpassword); PreparedStatement stmts = c.prepareStatement(“SELECT * FROM “+ vardbname +” where ROWNUM > ? and ROWNUM < ? “); PreparedStatement max = c.prepareStatement(“select max(ROWNUM) as txid from “+ vardbname) ) I’ve looking for the sample but i got … Continue reading “Oracle's ROWID / ROWNUM in MySQL”

How to output top 10 strings from MySQL database using Java

The database looks at New York’s subway system data. I would like to output the top 10 amounts of Exits and their corresponding Stations names on one line. I am very new to the Java and MySQL environments. This is the code that I am currently working with: public static void main(String[] args) throws Exception … Continue reading “How to output top 10 strings from MySQL database using Java”

Springboot Hibernate Entity Mapping

I have three tables with primary key in each table : table packetname, table customer, and table rent. Table PacketName public class PacketName implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.AUTO) private Integer idpacket; private String packetname; private String packetdesc; private String packetprize; private String packettime; //getter and setter etc } … Continue reading “Springboot Hibernate Entity Mapping”